apollographql / apollographql/apollo-server

"includeCookies" not respected for embedded Sandbox after initial reload

Open
#7,685 5 comments 2 reactions 0 assignees View on GitHub
🛰️ Explorer / Sandbox
Dominant language
TypeScript
Stars
14k
Forks
2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

### 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:
2. In `index.ts`, replace
```ts
ApolloServerPluginLandingPageLocalDefault({
embed: { runTelemetry: false },
}),
```

with

```ts
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:

https://github.com/apollographql/apollo-server/assets/6102639/419e1012-4a10-4d8b-893a-bd55ebefad7c

Contributor guide

Open the contributing guide

Research direction

Start with the ApolloServerPluginLandingPageLocalDefault configuration in index.ts and reproduce the issue using includeCookies: true in the linked CodeSandbox. Trace the embedded Sandbox behavior across its automatic reload and connection settings; done means cookies remain enabled after the reload and subsequent refreshes without manual re-enabling.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.