Skip to content

fix(player): tolerate blocked localStorage without breaking controls - #521

Merged
hoangsvit merged 3 commits into
stagingfrom
fix/player-storage-unavailable-20261117
Nov 16, 2026
Merged

hoangsvit merged 3 commits into
stagingfrom
fix/player-storage-unavailable-20261117

Conversation

@hoangsvit

Copy link
Copy Markdown
Member

Verified bug (storage/privacy audit)

components/player/Player.vue directly calls localStorage.getItem/setItem for queue, mini/compact mode and audio preferences. When a browser blocks storage (SecurityError, privacy/sandbox policy, quota), these uncaught calls can abort player initialization or UI button handlers, although storage persistence is optional.

Fix

  • Add small guarded read/write helpers; denied reads return null (default UI), writes return false without throwing.
  • Use them for player queue, mini/compact controls and audio preferences only; no change to stored keys or values.
  • Add Node regression tests for round trip, denied access and independent read/write failures.

Evidence and testing

  • Source reproduction: unguarded calls in Player.vue before fix, including onMounted initialization and setQueueOpen/togglePlayerCompact/setPlayerMini.
  • Focused helper smoke tests executed locally with Node 22.16.0: 3/3 pass. The committed regression suite has the same scenarios with additional volume assertion.
  • Full repository npm test, Node 24.15.0 CI, Nuxt build and browser/iOS QA not yet run; do not treat local helper tests as end-to-end proof.

Acceptance

  • Player mounts with storage unavailable, using default UI settings.
  • Queue/mini/compact controls remain usable when writes fail.
  • Normal storage persistence and audio preferences unchanged.
  • No autoplay, playback lifecycle or SEO changes.

Risk / QA

  • Persistence cannot survive reload when the browser denies storage; this is expected.
  • Verify Safari private/restricted contexts and normal Chrome storage, then inspect CI and manual playback/volume.
  • Independent branch based on staging SHA 658fe00e80a6c13e65a2a533364102f01932fd70; does not include pending fix(player): avoid idle 1-second queue schedule timer #520. No merge/deploy/release.

@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.

@hoangsvit
hoangsvit marked this pull request as ready for review November 16, 2026 23:11
@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 6c73bec into staging Nov 16, 2026
10 checks passed
@hoangsvit
hoangsvit deleted the fix/player-storage-unavailable-20261117 branch November 16, 2026 23:12

This branch was successfully deployed

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