Skip to content

Apply tracker edits through the session lifecycle - #221

Closed
linroid wants to merge 2 commits into
torrent-v2-11-tracker-config-commitfrom
torrent-v2-11-session-tracker-edit
Closed

linroid wants to merge 2 commits into
torrent-v2-11-tracker-config-commitfrom
torrent-v2-11-session-tracker-edit

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Tracker overrides can now be changed on an existing internal session. An active edit joins old discovery and peers, persists the replacement, and restarts discovery with the committed tiers. Failed persistence keeps the old configuration; cancellation after rename retains ownership of the committed replacement. Empty lists survive pause/resume without restoring metainfo trackers or changing private-torrent policy.

The command admits and snapshots input before suspension, permits one pending edit, and serializes with session lifecycle and resume-data saves. Configuration and checkpoint encoding reservations remain held for future saves, while a dedicated control allowance supports up to 256 replacement entries. Session shutdown joins command/save jobs before clearing in-memory configuration and returning credit. Saves after closure return null.

Stacked on #220; advances #162. Public SDK/daemon/UI exposure, revision conflict handling, and remaining production gates are still open.

Validation: 574 JVM and 553 executed iOS tests passed with zero failures/errors/skips. Native-runtime guard and two pinned v1 conformance scenarios passed. New tests cover real-engine stop/start ordering and empty overrides, failed edits and retry, cancellation after rename and during joined cleanup, input mutation, concurrent-edit rejection, and configuration/checkpoint workspace admission rejection without pausing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 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-09-12T22:56:37.873757Z fe5f967 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe5f967d4f

ℹ️ 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".

Comment on lines +82 to +83
val restart = job?.isActive == true
stopLocked()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve completion when applying tracker edits

If a non-seeding torrent finishes just before this edit acquires the lifecycle mutex, job is already inactive, so restart is false and stopLocked() overwrites FINISHED with PAUSED without resuming it. If TorrentDownloadSource has not yet sampled the brief FINISHED state, its loop only exits for FINISHED, SEEDING, or STOPPED, leaving the download stuck indefinitely; preserve the terminal state or restart when this race occurs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 107811d. Edits capture the state of an inactive session and restore it in finally, including persistence failure or cancellation, instead of leaving a finished session paused. The regression waits for a non-seeding session job to finish, then checks both failed and successful edits. It failed before the fix (FINISHED versus PAUSED) and passes afterward; the session/engine focused suite also passed.

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

  742 files  + 5    742 suites  +5   4m 15s ⏱️ -8s
3 104 tests +24  3 104 ✅ +24  0 💤 ±0  0 ❌ ±0 
4 252 runs  +40  4 252 ✅ +40  0 💤 ±0  0 ❌ ±0 

Results for commit 107811d. ± Comparison against base commit 937d18d.

♻️ This comment has been updated with latest results.

@linroid

linroid commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

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)

@linroid linroid closed this Sep 20, 2026
@linroid
linroid deleted the torrent-v2-11-session-tracker-edit branch September 20, 2026 11:13
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.

1 participant