Repository navigation
fix: in-flight request payload sync - #3940
diegosouzapw merged 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Obrigado, @rdself! 🙏 Boa pegada na causa-raiz: o |
Integrated into release/v3.8.26 — keep pendingById in sync with the queue detail (Object.assign in place). Validated alongside diegosouzapw#3937: typecheck:core clean, 42/42 request-logger + lifecycle tests, eslint 0 errors, file-size OK.
Summary
Fixes stale payloads in active in-flight request details by keeping the pending detail queue and the ID lookup map synchronized when request metadata is updated.
Root cause
trackPendingRequest()stores the same pending request detail in both the per-connection queue andpendingById.updatePendingRequest()later replaced the queue entry with a new object, leavingpendingByIdpointing at the original registration-time snapshot. The active log detail endpoint readspendingById, so in-flight details could show an outdated provider request while completed logs showed the final sanitized provider payload.Impact
Active request details now reflect updates such as provider payload normalization before the request completes. The original client request remains unchanged, while the provider request view can update from the initial payload to the final provider-bound payload.
Validation
node --import tsx --import ./open-sse/utils/setupPolyfill.ts --test tests/unit/request-logger-endpoints.test.tsnode --import tsx --import ./open-sse/utils/setupPolyfill.ts --test tests/unit/active-request-stream-chunks-lifecycle.test.ts