Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"includeCookies" not respected for embedded Sandbox after initial reload #7685

Open
mderriey opened this issue Aug 14, 2023 · 4 comments
Open

Comments

@mderriey
Copy link

mderriey commented Aug 14, 2023

Issue Description

The very first time someone accesses the embedded Sandbox configured with cookies included by default, the following happens:

  1. Page loads, go to connection settings, cookies are included (wanted behaviour)
  2. A ton of requests happen in the background
  3. At some point, the page/frame reloads automatically
  4. Go to connection settings, cookies are disabled (unwanted behaviour)

At this stage, refreshing the page entirely doesn't bring back the initial config, which means users explicitly have to go to connection settings and enable cookies.
After doing this, though, the preference is persisted across refreshes.

Link to Reproduction

See below

Reproduction Steps

Apologies, I tried to sign up / log in to CodeSandbox, but it seems it doesn't work.

However, repro steps are super simple:

  1. Start from the Apollo CodeSandbox: https://codesandbox.io/p/sandbox/apollo-server-typescript-3opde

  2. In index.ts, replace

    ApolloServerPluginLandingPageLocalDefault({
      embed: { runTelemetry: false }, 
    }),

    with

    ApolloServerPluginLandingPageLocalDefault({
      includeCookies: true,
      embed: { runTelemetry: false }, 
    }),
  3. Open an incognito/InPrivate tab, and reach the CodeSandbox public URL

  4. Observe what happens as per the description.

Here's also a video of it showing on a personal project:

apollo-cookies-shenanigans-repro.mp4
@mayakoneval
Copy link
Contributor

Hi! According to our landing page docs, includeCookies should be at the top level, instead of nested under embed.

Could you let me know if that works for you?

Thanks!

@mderriey
Copy link
Author

Hi @mayakoneval,

Apologies, this was a typo, we do have includeCookies at the top level, as indicated in the docs you linked to. I edited the original post to avoid confusion.

I finally managed to log in to Sandbox and create a proper repro, which you can find here: https://codesandbox.io/p/sandbox/admiring-browser-ln69rj?file=/src/index.ts:1,1.

Remember to open this in an incognito/InPrivate window, and to wait for the frame to reload before checking again whether cookies are configured to be included, as I did in the video in the original post.

Cheers

@mderriey
Copy link
Author

Hey @mayakoneval, did you get a chance to have a look at this?

@mderriey
Copy link
Author

mderriey commented Apr 4, 2024

Hi @mayakoneval, this is still an issue for us, the includeCookies setting doesn't work, or rather is lost, on the very first load of the embedded Sandbox.

Any chance you could take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants