Skip to content

fix: wait for matching history response - #2007

Open
Aafimalek wants to merge 1 commit into
1jehuang:masterfrom
Aafimalek:fix-history-response
Open

Aafimalek wants to merge 1 commit into
1jehuang:masterfrom
Aafimalek:fix-history-response

Conversation

@Aafimalek

Copy link
Copy Markdown
Contributor

Closes #731

A swarm status broadcast can arrive before the reply to GetHistory, causing the client to return that broadcast instead of the requested history. Wait for a matching history or error response within the existing ten-event limit.

The regression test exercises the real local transport with an interleaved swarm status, a stale history response, the matching history, and a matching error. It failed before the change with unexpected response: SwarmStatus and passed afterward on Windows.

Validation: cargo test -p jcode-app-core --lib history_request_ignores_interleaved_status --locked; cargo fmt --all --check.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] Safe to merge within the reviewed scope; local-transport checks confirmed matching-response selection and preservation of the existing event limit.

Summary

get_history_event now returns only a History or Error whose ID matches the request, skipping unrelated broadcasts and stale replies while retaining the existing ten-event limit.

  • History requests return only their matching reply.

Reviews (1) · Last reviewed commit: "fix: wait for matching history response" · Reviewed by Greptile

@Aafimalek

Copy link
Copy Markdown
Contributor Author

Hi, following up on this fix for a swarm status event arriving before the requested history response. The PR includes a transport regression test for the interleaved events. Is there anything else needed to help review it? Thanks!

xenking added a commit to xenking/jcode that referenced this pull request Nov 22, 2026
xenking added a commit to xenking/jcode that referenced this pull request Nov 22, 2026
Upstream-PR: 1jehuang#1357
Upstream-PR-Commit: 1jehuang#1357 0da5e81
Upstream-PR: 1jehuang#1362
Upstream-PR-Commit: 1jehuang#1362 5962058
Upstream-PR: 1jehuang#1486
Upstream-PR-Commit: 1jehuang#1486 fadc624
Upstream-PR: 1jehuang#1733
Upstream-PR-Commit: 1jehuang#1733 01f3415
Upstream-PR: 1jehuang#1750
Upstream-PR-Commit: 1jehuang#1750 1ac0c82
Upstream-PR: 1jehuang#1822
Upstream-PR-Commit: 1jehuang#1822 73f85fc
Upstream-PR: 1jehuang#1912
Upstream-PR-Commit: 1jehuang#1912 36d7682
Upstream-PR: 1jehuang#1978
Upstream-PR-Commit: 1jehuang#1978 0f55643
Upstream-PR: 1jehuang#2007
Upstream-PR-Commit: 1jehuang#2007 638f87c
Upstream-PR: 1jehuang#2213
Upstream-PR-Commit: 1jehuang#2213 c5e1487
Upstream-PR: 1jehuang#2234
Upstream-PR-Commit: 1jehuang#2234 0d4d5d4
Upstream-PR: 1jehuang#2266
Upstream-PR-Commit: 1jehuang#2266 217ddc2
Upstream-PR: 1jehuang#2267
Upstream-PR-Commit: 1jehuang#2267 e98c40b

This branch has not been deployed

No deployments
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.

Flaky e2e: reload_notifies_clients_across_independent_sessions loses the history reply to a racing SwarmStatus broadcast

1 participant