fix: make bridge rpc text sends idempotent#159
Conversation
8aed5f2 to
ac27a79
Compare
|
Codex review: found issues before merge. Reviewed July 9, 2026, 7:16 PM ET / 23:16 UTC. Summary Reproducibility: yes. for the linked bug: the canonical issue gives a concrete fresh-process imsg rpc loop and chat.db grouping checks on a macOS bridge host. I did not run live Messages delivery from this Linux checkout. Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Land the atomic queue-claim fix after removing the release-owned changelog edit and attaching redacted live proof that direct to and chat_guid bridge sends produce one response, one outbound row, one unique GUID/text, and one recipient-visible delivery per request. Do we have a high-confidence way to reproduce the issue? Yes, for the linked bug: the canonical issue gives a concrete fresh-process imsg rpc loop and chat.db grouping checks on a macOS bridge host. I did not run live Messages delivery from this Linux checkout. Is this the best way to solve the issue? Yes, conditionally: claiming the inbox file before reading or dispatch is the narrowest source-level fix for a cross-process duplicate consumer race, but it needs live delivery proof and the release-owned changelog edit removed before merge. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d9bd9c754d50. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
ac27a79 to
41481e4
Compare
41481e4 to
9f2bcf2
Compare
Summary
com.apple.MobileSMSprocess and keep skipped injected processes from deleting the real bridge-ready lock during teardownRefs #158.
Why
The reported failure produces two physical rows with distinct GUIDs from one logical bridge request at a stable ~60–64 ms gap, while the single response can identify either row. That matches two injected inbox watchers reading and dispatching the same finalized request before either removes it.
The previous candidate pinned a client-generated IMMessage GUID. Current macOS 26 plain-text construction already assigns one GUID before its single dispatch, so that approach did not prevent two
sendMessage:calls. This rewrite fixes ownership at the queue boundary: a same-directory atomic rename gives exactly one process the request before any side effect.Verification
2ea890f(main)DEVELOPER_DIR=/Applications/Xcode-26.6.app/Contents/Developer make test— 375 tests passedDEVELOPER_DIR=/Applications/Xcode-26.6.app/Contents/Developer make lint— passed; 7 existing warnings, 0 serious violationsDEVELOPER_DIR=/Applications/Xcode-26.6.app/Contents/Developer make build— universal CLI (arm64,x86_64) and helper (arm64e,arm64,x86_64) built successfullyLive validation gate
Not merge-ready yet. The available test host has SIP enabled and reports
v2_ready: false, so it cannot exercise injected IMCore delivery.@lowcode-garage please run the issue's fresh-process probe against this head on the reproducing SIP-disabled Mac for both direct
toandchat_guidsends. Please include request count, response count, sender-row count, unique text/GUID count, response-GUID-to-row mapping, duplicate/missing texts, and recipient-side confirmation that each request delivered exactly once. The bridge log now records request UUID, PID, and process name so we can also confirm one handler claimed each request.