Repository navigation
fix(edge): a aba do app guarda o cookie SameSite=Lax; só o iframe da Prévia particiona - #1211
Merged
Merged
Conversation
added 2 commits
November 21, 2026 19:02
…ts partitioned session cookie
…via frame partitions them Safari drops a Partitioned cookie set at the end of the tab's redirect chain from the Hub (app, Hub, pass, app), so a tab that comes back with a live Hub session never keeps the pass's session and loops until too many redirects. The tab's cookies go back to the step 8 attributes; the frame keeps SameSite=None; Partitioned (step 14.1, decision 0024).
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
No Safari do iPhone, voltar a um app publicado com o Hub ainda logado dava "too many redirects": a barra alternava entre o Hub e o app.
Causa raiz, em linguagem simples. Quem abre o app sem sessão do app faz um caminho só de redirecionamentos: app → Hub (
/apps/open) → app (/__conexus/passagem?code=…) → app (/). A passagem entrega a sessão do app num cookie. Desde a etapa 14.1 esse cookie saiSameSite=None; Partitioned, também na aba. O Safari descarta um cookiePartitionedgravado no fim de um caminho de redirecionamentos que saiu do site e voltou (WebKit bug 306194, Safari 26.2 no macOS e no iOS). Sem o cookie, a volta a/não tem sessão, o app manda de novo ao Hub, o Hub (logado) devolve outra passagem, e assim até o Safari desistir.Na janela anônima não há sessão do Hub: a tela de login do Hub corta o caminho, e o cookie chega depois de um só salto entre sites, por isso abre. "Depois de um tempo fora": o cookie do app é de sessão do navegador e pode sumir, enquanto o do Hub continua valendo.
What changed
apps/edge/src/headers.ts:placeOflêSec-Fetch-Dest(o mesmo sinal quetoHubjá usava).setCookierecebe o lugar: na aba saiSameSite=Lax, semPartitioned(o valor da etapa 8, que funcionava no iPhone). No iframe da Prévia continuaSameSite=None; Partitioned.apps/edge/src/dispatch.ts: o vínculo, a sessão e o apagar da sessão usam o lugar do pedido.Scope
Só a borda. Nenhum contrato, tabela, migração ou tela muda.
Tradeoffs
SameSite=None; Partitioned. O fundador aprovou a mudança em 2026-11-21: "Okay", com a opção (a): o código entra agora, e o texto novo da S24 (a PréviaSameSite=None; Partitioned, a abaSameSite=Lax) vai para o PR de método depois que o cartão do Registro fechar. Os guias não mudam durante uma etapa em construção (delivery L20, method-freeze). A separação entre a Prévia e a aba (decisão 0024) continua: um iframe de outro site não recebe cookieLax, e a aba não recebe o cookie particionado do Hub.Blast Radius
Quem já tem um cookie particionado antigo na aba: ele vale até a sessão acabar. Quando acaba, a pessoa passa uma vez pelo Hub e recebe o cookie novo.
Verification
apps/edge/src/dispatcher-tab.test.ts, que segue os 303 como a aba do Safari. Commit do teste (antes da correção):/ → hub → passagem → /repetido até o limite de 16 saltos. Com a correção:['/', 'hub', '/__conexus/passagem', '/']e o app responde.npm run test -w apps/edge: 67 passam. Uma falha (db,DB_DEADLINE) e 14 testes cancelados acontecem igual na base04a4de6c, então vêm do ambiente.FRAMEfaz 10 testes falharem; tudoTABfaz 3 falharem.npm run checkverde,method-freezeincluído, atécheck:workflows, que precisa de Docker (não há neste ambiente).https://claude.ai/code/session_012gWBFUCp42GkXrzUfg8PLE
Generated by Claude Code