Skip to content

fix: in-flight request payload sync - #3940

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.26from
rdself:coder/inflight-pending-detail-sync-v326
Jun 16, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.26from
rdself:coder/inflight-pending-detail-sync-v326

Conversation

@rdself

@rdself rdself commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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 and pendingById. updatePendingRequest() later replaced the queue entry with a new object, leaving pendingById pointing at the original registration-time snapshot. The active log detail endpoint reads pendingById, 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.ts
  • node --import tsx --import ./open-sse/utils/setupPolyfill.ts --test tests/unit/active-request-stream-chunks-lifecycle.test.ts

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@rdself
rdself marked this pull request as ready for review June 15, 2026 23:52
@rdself
rdself requested a review from diegosouzapw as a code owner June 15, 2026 23:52
Copilot AI review requested due to automatic review settings June 15, 2026 23:52
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rdself rdself changed the title [codex] fix in-flight request payload sync fix in-flight request payload sync Jun 15, 2026
@rdself rdself changed the title fix in-flight request payload sync fix: in-flight request payload sync Jun 15, 2026
@diegosouzapw
diegosouzapw merged commit b250e08 into diegosouzapw:release/v3.8.26 Jun 16, 2026
3 checks passed
@diegosouzapw

Copy link
Copy Markdown
Owner

Obrigado, @rdself! 🙏 Boa pegada na causa-raiz: o updatePendingRequest() recriava o objeto e deixava o pendingById apontando pro snapshot de registro, então o detalhe in-flight mostrava o payload antigo. O Object.assign in-place mantém as duas views na mesma referência, e o teste que assere a identidade (getPendingById().get(id) === queueDetail) é exatamente a regressão certa. Integra limpo com o #3937 (funções distintas no mesmo arquivo). Validei junto: typecheck:core limpo, 42/42 testes, eslint 0 erros. Entra no próximo release. 🚀

@diegosouzapw diegosouzapw mentioned this pull request Jun 16, 2026
@rdself
rdself deleted the coder/inflight-pending-detail-sync-v326 branch June 24, 2026 03:25
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants