Skip to content

fix(player): avoid idle 1-second queue schedule timer - #520

Merged
hoangsvit merged 5 commits into
stagingfrom
fix/queue-reference-clock-idle-20261117
Nov 16, 2026
Merged

hoangsvit merged 5 commits into
stagingfrom
fix/queue-reference-clock-idle-20261117

Conversation

@hoangsvit

Copy link
Copy Markdown
Member

Verified source-level bug

components/player/Queue.vue starts a 1-second setInterval on every mount, including station-list view, hidden queue and stations with no reference schedule. The callback guards state, but the interval itself still wakes the main thread. This is a narrow performance/timers audit fix related to #328.

Change

  • Derive clock eligibility from schedule tab, queue visibility, reference-guide mode and nonempty programme list.
  • Start the timer only while eligible; stop on deactivation and component teardown; refresh wall-clock immediately on reactivation.
  • Extend station-schedule.test.mjs source regression assertions to ensure clock activation/cleanup are wired.

Evidence / tests

  • Before: unconditional scheduleClockTimer = setInterval(..., 1000) in onMounted.
  • After: watch(needsScheduleClock, ..., { immediate: true }) inside onMounted, with explicit stopScheduleClock().
  • Source review completed. npm test, Nuxt build and browser QA not yet executed in this run; CI must confirm. This is not a claim of measured performance improvement.

Acceptance criteria

  • No 1-second queue timer when the station list is active, queue hidden, or reference programme absent.
  • Exactly one timer while a visible reference schedule is selected; clock resumes with current wall time after reactivation.
  • Unmount clears the interval; schedule auto-scroll and playback remain unchanged.

Risks

  • A delayed reactive state transition may briefly defer clock activation; watch is created after mount and immediately synchronized.
  • Manual browser verification of schedule transitions and mobile sidebar is still required.

No production deploy, release, branch protection or secrets changes.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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.

Share

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

ePlus OnAir — PR Preview

🗃️ Preview expired. This PR is closed; the Preview link is hidden.

View build status

Preview is noindex; the full catalog is available on Staging after merge.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@hoangsvit
hoangsvit merged commit 58cb1f9 into staging Nov 16, 2026
4 of 5 checks passed
@hoangsvit
hoangsvit deleted the fix/queue-reference-clock-idle-20261117 branch November 16, 2026 23:13

This branch was successfully deployed

1 active deployment
preview — e1508869 Deployed Nov 16, 2026 by hoangsvit via Remove closed PR Preview #512
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