widget: session renewal ordering and refresh-margin follow-ups after 0.4.0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- authentication, frontend
Direzione di ricerca
Start with plans/reports/code-reviewer-261026-2104-webchat-pr6-merge-review.md, then read packages/dewee-webchat/src/widget/api-client.ts around ensureSession, renewSession and loadSession for items 1-3 and 5. For item 4, read handler.ts and its fixed Access-Control-Allow-Headers list. Done means each follow-up is fixed or explicitly justified, with renewal no longer joining a request that began before sign-in and the CORS header list extensible.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Follow-ups from the isolated review of the merge of main into #6 (custom headers/fetch plus identity sessions, 0.4.0). None of these blocks a release, and none can send another user's token.
- M2:
renewSession()can return an anonymous session. Inpackages/dewee-webchat/src/widget/api-client.ts(aroundensureSession/renewSession),renewSession()reuses a/sessionrequest that is already in flight. If that request started before the host signed the user in, the widget keeps the anonymous session after sign-in. Fix: add a generation counter so that a renewal ignores, and does not join, an older in-flight load. - L6:
headers(true)can send the stored anonymous token while a renewal is loading.loadSessionsetsthis.sessionto the stored anonymous visitor before it creates the new session. Ahistoryorlinkcall that is waiting on host headers can therefore send that anonymous token instead of waiting for the signed-in one. The impact is limited to the same browser's own visitor, andrenewSession()reloads the conversation. Fix: also wait for an in-progress load, or correct the comment, which currently promises "never none or a stale one". - L1: the anonymous refresh margin mixes clocks. Anonymous sessions have no
expiresIn, so freshness compares the server'sexpiresAtwith the browser clock. With a short anonymous TTL and a browser clock that runs ahead, every request mints a new/session(and a Turnstile challenge). Fix: sendexpiresInfor anonymous sessions too. - L3: CORS cannot be extended. The built-in handler's
Access-Control-Allow-Headerslist is fixed (handler.ts), so a cross-origin endpoint cannot accept the extraheadersthe widget now supports. - L4: stale entries stay in storage. A signed-in entry stored by a 0.3.0 widget is ignored but never deleted from localStorage.
Review report (dewee repo): plans/reports/code-reviewer-261026-2104-webchat-pr6-merge-review.md. Part of nextlevelbuilder/dewee#1450.
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 1
- Merge medio
- 1g 6h
- PR unite (30g)
- 5
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextlevelbuilder/dewee-webchat
-
PHP backend: fixed file names in the shared temp dirForse già presa @dannyward630 l’ha presa 1 giorno fa. Apertaai-handle
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
ai-handle
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
-
ai-handle enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
ai-handle enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
ai-handle bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 53/100
Tutte le issue di nextlevelbuilder/dewee-webchat
Issue simili
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Export the Hemi Earn Router address and the Router and Agent ABIs from `@vetro-protocol/earn`Apertahemi-earn
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vetro-protocol/vetro-monorepo#1043 ·
I maintainer di solito rispondono entro 1 giorno
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
STRML/omp-classifier#206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
I maintainer di solito rispondono entro 1 giorno
-
dashboard enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Olanetsoft/agent-lookout#225 ·
I maintainer di solito rispondono entro 1 giorno