Draft
Conversation
Actor re-entrancy across `await flush_event` allowed concurrent `handle_event` calls to mutate `events` and `remaining` mid-iteration. Snapshot both collections before the loop. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
…ions has_ev Set and other collections were accessed from multiple relay handler streams without synchronization. @mainactor serializes all access through the main thread. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
…ubscribeAll Handler registration and removal can mutate the handlers array between yield calls during actor re-entrant suspension points. Snapshot the array before iterating. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
ConcurrentBarrier, AtomicCounter, ResumeTracker, and concurrentStress helpers for deterministic race condition testing across all 27 fixes. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
HomeModel is already @mainactor, which serializes access to already_reposted and other shared state even when parallel Tasks call process_event. Tests confirm the serialization is effective. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
…g callback The ping callback fires on an arbitrary thread. Writing @published properties (isConnected, isConnecting) off the main thread can crash SwiftUI. Wrap in DispatchQueue.main.async. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
These methods mutate events and incoming arrays that are also accessed by @mainactor insert(). Without isolation, concurrent filter + insert leaves has_event and events inconsistent. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: alltheseas <[email protected]>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry picked version of #3638
Work in progress.
Checklist
Experimental Feature Checklist
Tip
This Pull Request is an experimental feature for Damus Labs, and follows a fast-track review process.
The overall requirements are lowered and the review process is not as strict as usual. However, the feature will only be available for Purple users who opt-in.
Changelog-Added: Added experimental feature <X> to Damus LabsStandard PR Checklist
Closes:orFixes:tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Please provide a test report for the changes in this PR. You can use the template below, but feel free to modify it as needed.
Device: [Please specify the device you used for testing]
iOS: [Please specify the iOS version you used for testing]
Damus: [Please specify the Damus version or commit hash you used for testing]
Setup: [Please provide a brief description of the setup you used for testing, if applicable]
Steps: [Please provide a list of steps you took to test the changes in this PR]
Results:
Other notes
[Please provide any other information that you think is relevant to this PR.]