You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(renderer): the first play after a launch reads the seeding switch - #31
"Seed what you watch" was ignored after every launch or page reload.
SeedPublish (packages/renderer/src/seeding/controller.ts) started with watched: false and only asked the worker for the switch once something was already being served or Settings was opened. onPlay returned early on that starting value, so the first play after a launch was never stored or seeded, whatever the worker's seeding.json said.
Found by the real-host proof (draft #30): the installed app played a video over the public HyperDHT with the switch on, then published no beacon in about 36 minutes, so a fresh nutflix-pear fetcher had nobody to fetch from.
Fix: the controller remembers whether it has read the switch. A play before that asks the worker first, then hands the play over if the switch is on. A launch with nothing played still sends the worker no request (the existing "asks the worker nothing until it is told something is served" test is unchanged).
Tests (packages/renderer/src/__tests__/seeding.test.ts), on a fresh controller that has read nothing:
switch on: the first play reads the status, then is handed over with its signed manifest;
switch off: the status is read and nothing is handed over;
a switch already read is not asked for again.
The existing on/off tests read the status before the play, which is why they never caught this.
Summary by CodeRabbit
Bug Fixes
Playback now checks the current seeding setting before starting a watch. When seeding is disabled, playback proceeds without starting one; when enabled, playback starts with the required session information.
The setting is reused for later plays instead of being checked repeatedly, and successful watch requests refresh the status. This keeps playback behavior aligned with the latest seeding setting.
"Seed what you watch" was ignored after every launch or page reload. The
controller started with `watched: false` and only asked the worker once
something was already served or Settings was open, so `onPlay` returned
early and the first play was never stored or seeded, whatever the
worker's switch said. Found by the real-host proof: the installed app
played a video over the public DHT, then published no beacon in 36 min.
The controller now remembers whether it has read the switch. A play
before that asks the worker first; a launch with nothing played still
sends it no request. Three tests cover a fresh controller: on (the play
is handed over), off (nothing is), and a switch already read (not asked
again).
No actionable comments were generated in the recent review.
Walkthrough
SeedPublish now reads worker seeding status before deciding whether to hand off the first play. It tracks whether status has been adopted, and tests cover enabled, disabled, and cached status cases.
Changes: Seeding status and play handoff
Layer / File(s)
Summary
Status-gated play handoff packages/renderer/src/seeding/controller.ts, packages/renderer/src/__tests__/seeding.test.ts
SeedPublish reads worker status before the first play handoff and requests seeding.watch only when watched is true. It caches whether status has been adopted. Tests cover enabled and disabled status, and verify that later plays do not request status again after refreshSeeding reads it.
This change makes the first play after a launch or reload read the worker's seeding switch before deciding whether to hand the play over. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the actual fix: the first play after a launch now reads the seeding switch before deciding whether to hand the play over. The change adds status tracking to SeedPublish.onPlay, and the…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the actual fix: the first play after a launch now reads the seeding switch before deciding whether to hand the play over. The change adds status tracking to SeedPublish.onPlay, and the tests cover that first-play path. The title uses the conventional fix(renderer) prefix and is specific enough for a reviewer scanning history.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Not set means no limit was configured after inheritance. Use @coderabbitai configuration to inspect the resolved settings and their sources.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Central YAML; Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 6f5189b7-5470-4720-a54d-41c99c2e6149
Commits
Reviewing files that changed from the base of the PR and between c6af5c5 and e3d9065.
Files selected for processing: 2
packages/renderer/src/__tests__/seeding.test.ts
packages/renderer/src/seeding/controller.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
…#31)
"Seed what you watch" was ignored after every launch or page reload. The
controller started with `watched: false` and only asked the worker once
something was already served or Settings was open, so `onPlay` returned
early and the first play was never stored or seeded, whatever the
worker's switch said. Found by the real-host proof: the installed app
played a video over the public DHT, then published no beacon in 36 min.
The controller now remembers whether it has read the switch. A play
before that asks the worker first; a launch with nothing played still
sends it no request. Three tests cover a fresh controller: on (the play
is handed over), off (nothing is), and a switch already read (not asked
again).
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
size/MLines changed by this pull request: M (sovtechpro[bot])
1 participant
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.
"Seed what you watch" was ignored after every launch or page reload.
SeedPublish(packages/renderer/src/seeding/controller.ts) started withwatched: falseand only asked the worker for the switch once something was already being served or Settings was opened.onPlayreturned early on that starting value, so the first play after a launch was never stored or seeded, whatever the worker'sseeding.jsonsaid.Found by the real-host proof (draft #30): the installed app played a video over the public HyperDHT with the switch on, then published no beacon in about 36 minutes, so a fresh nutflix-pear fetcher had nobody to fetch from.
Fix: the controller remembers whether it has read the switch. A play before that asks the worker first, then hands the play over if the switch is on. A launch with nothing played still sends the worker no request (the existing "asks the worker nothing until it is told something is served" test is unchanged).
Tests (
packages/renderer/src/__tests__/seeding.test.ts), on a fresh controller that has read nothing:The existing on/off tests read the status before the play, which is why they never caught this.
Summary by CodeRabbit