Skip to content

test: fix the duplicate-envelope race pin for cross-isolate unwrapping - #710

Closed
grunch wants to merge 1 commit into
mainfrom
fix/dispute-duplicate-envelope-race
Closed

test: fix the duplicate-envelope race pin for cross-isolate unwrapping#710
grunch wants to merge 1 commit into
mainfrom
fix/dispute-duplicate-envelope-race

Conversation

@grunch

@grunch grunch commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

dispute_chat_duplicate_envelope_test.dart fails on main. Root cause: the pin was added (during #702's review) while envelope unwrapping was synchronous; #705 later moved the per-message crypto into Isolate.run, and pumpEventQueue cannot observe cross-isolate port replies — the assertion runs before the valid envelope finishes verifying. The two PRs crossed in flight (#705 was stacked on #701, whose branch predated this test), so CI never ran the combination.

The product behaviour is correct (verified by log trace): the forged copy fails the p-tag check and the valid copy is processed on its own; only the test's wait was implementation-timed.

Changes

Test plan

  • test/features/disputes/ — all green (previously 1 failing on main)
  • flutter analyze — no new issues

🤖 Generated with Claude Code

https://claude.ai/code/session_018fTxqxhpdL5siTgKZqwtur

… pin

The pin was added while envelope unwrapping was synchronous; since the
per-message crypto moved into Isolate.run, pumpEventQueue cannot observe
the cross-isolate port reply and the assertion ran before the valid
envelope finished verifying. The two isolate PRs crossed in flight (the
worker-isolate branch was stacked on the conversation-key branch, which
predated this test), so CI never ran this combination.

Bounded 5 s condition wait, same pattern as dispute_chat_reload_test.
The product behaviour is correct: the forged copy fails verification and
the valid copy is processed on its own.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 7347990d-1e92-40e5-b07b-9ae805895e60

📥 Commits

Reviewing files that changed from the base of the PR and between ef3aad3 and b6035a8.

📒 Files selected for processing (1)
  • test/features/disputes/dispute_chat_duplicate_envelope_test.dart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T22:41:04.074835Z b6035a8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Catrya Catrya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK

@grunch

grunch commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Superseded by #709, closing.

The same fix landed on main in 0381ff8 (#709): pumpEventQueue(times: 200) in dispute_chat_duplicate_envelope_test.dart is replaced by a bounded poll on the observable condition, since unwrapping now runs through Isolate.run and a microtask pump count cannot see cross-isolate port replies. Only the shape differs — a _waitFor helper there vs. the inline loop here.

This PR's diff no longer applies (the pumpEventQueue(times: 200) line it removes is gone from main), so leaving it open would only produce a conflict.

All the PRs that were red on this test (#711#715, #717, #718, plus #716 through its base) have had main merged in and are picking up the fix from there.

@grunch grunch closed this Sep 1, 2026
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.

2 participants