Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f567568fa6
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (preferCurrent && current != null && !oldPeersClosed) beforeSwitch() | ||
| val replacement = configuration.tiers.map { it.shuffled().toMutableList() } |
There was a problem hiding this comment.
Recheck cancellation after the peer-cleanup barrier
When parent cancellation arrives while beforeSwitch() is completing, the callback can return into an already-cancelled context and the replacement is still installed because the remaining mutations contain no cancellation check. This violates replaceTrackers()'s cancellation guarantee: the caller can observe cancellation while tiers, cached IDs, statuses, and the revision have nevertheless changed. Check currentCoroutineContext().ensureActive() immediately after the cleanup callback and before mutating configuration.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 1ebda08 with ensureActive immediately after private cleanup and before installing replacement state. The new regression cancels exactly as cleanup returns: it fails before the fix and now preserves the old revision and attempt state. The combined child stack passed 553 JVM and 532 executed iOS tests with zero failures.
|
Superseded by #237 (Tracker lifecycle, editing and discovery privacy) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Adds serialized tracker replacement: validate and snapshot the new tiers before suspension, attempt a bounded stop on the old configuration, await private peer cleanup, then install the replacement. Caller cancellation or cleanup failure prevents installation. Successful edits discard cached tracker IDs, reset lifecycle/backoff timing, and increment a diagnostic configuration revision while retaining the full torrent topic binding.
Replacement is bounded to 256 entries/tiers and 8192 characters per absolute HTTP(S)/UDP URL. Empty configurations are supported; unsupported schemes and UDP user-info are rejected before old tracker contact. Endpoint policy authorization remains the caller's responsibility.
Stacked on #215; advances #162. Tests cover stop/cleanup/start order, credential state, mutable input, stop timeout versus caller cancellation, invalid edits, cleanup failure, empty configuration, and topic isolation. SDK/daemon/UI commands and persistence remain separate roadmap work.
Validation: 547 JVM and 526 executed iOS simulator tests, zero failures/errors/skips; native-runtime guard and both pinned v1 conformance scenarios passed. Only test API opt-in annotations changed afterward; JVM and iOS test compilation passed again.