widget: session renewal ordering and refresh-margin follow-ups after 0.4.0
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- authentication, frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 7
- Fork
- 1
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextlevelbuilder/dewee-webchat
-
PHP backend: fixed file names in the shared temp dirCó thể đã có người làm @dannyward630 đã nhận hôm nay. Đang mởai-handle
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
ai-handle
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
-
ai-handle enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
ai-handle enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
ai-handle bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 53/100
Tất cả issue của nextlevelbuilder/dewee-webchat
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
CopilotKit/openmuse#215 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
b:minor bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
software-mansion/argent#1698 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày