feat(queue): multi-queue preload cache, preload-N setting, manual preload - #76
Conversation
…load Signed-off-by: Robbin "Roboroads" Schepers <robbin@deschepers.nl>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces the single-entry ChangesMulti-queue path-keyed preloader with window ownership, manual preload, and RAM guard
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/streamline/renderer/src/audio/track-preload.ts`:
- Around line 115-118: The setWindow method calls reconcile() synchronously on
line 117, which can evict paths before a same-tick take(path) call can claim
them, breaking the hand-off safety guarantee. Defer the reconcile() call in the
setWindow method to a microtask using queueMicrotask() instead of calling it
synchronously. Apply the same fix to the other synchronous reconcile() call
mentioned at lines 132-135 to ensure consistent microtask-deferred
reconciliation across all window update operations.
In `@packages/streamline/renderer/src/modules/queue/Queue.svelte`:
- Around line 83-86: The preloadCount derived value on line 83 only enforces a
minimum bound of 0 using Math.max, but does not enforce an upper bound on the
value from currentSettings.preloadCount. This allows malformed or oversized
settings values to create an unexpectedly large preload window and increase
decode pressure. Update the preloadCount derivation to clamp the value to both a
minimum of 0 and a reasonable maximum (such as the length of the items array or
a configurable limit) to ensure the JSON-derived settings are defensively
bounded at runtime before being used in the windowPaths calculation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b94ac32c-35ab-412a-ae1f-dc05210b9415
📒 Files selected for processing (6)
packages/streamline/renderer/src/audio/track-preload.spec.tspackages/streamline/renderer/src/audio/track-preload.tspackages/streamline/renderer/src/modules/queue/Queue.component.spec.tspackages/streamline/renderer/src/modules/queue/Queue.sveltepackages/streamline/renderer/src/modules/queue/QueueSettingsModal.component.spec.tspackages/streamline/renderer/src/modules/queue/QueueSettingsModal.svelte
Signed-off-by: Robbin "Roboroads" Schepers <robbin@deschepers.nl>
Replaces the single-entry global preloader with one shared, path-keyed cache that holds the union of every queue's preload window, so multiple autoplaying queues no longer evict each other (fixes the CodeRabbit finding skipped on #69). Adds a per-queue "preload first N tracks" setting (default 1, with a RAM hint), a manual per-row preload button, and a one-time toast warning when the decoded cache exceeds 1 GB.
Closes #75.
Summary by CodeRabbit