Files
romm/frontend/src/plugins
Georges-Antoine Assi db537728f1 feat(v2): scope stored preferences to the signed-in user (#5098)
* feat(v2): scope stored preferences to the signed-in user

Preferences in localStorage were shared by everyone using the same
browser, so one person's gallery layout, scan providers, chosen cores
and so on carried over to the next account. useUserLocalStorage stores
them under `user:<id>:<key>` while someone is signed in, and under the
bare key while signed out. The first user to sign in after this change
claims any unscoped value, so existing preferences carry over once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(v2): address Greptile review on user-scoped storage

- Scope the core, BIOS and disc keys the shared EmulatorJS player writes
  (and v1's matching reads), so a game start no longer leaves bare keys
  for the next user to claim.
- Build the test user with userFixture.
- Trim the helper's header comment.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(v2): store the jukebox session under the user's storage key

The resume session now goes through userStorage like the other stored
preferences, so each user gets their own key instead of one shared key
carrying a userId to check on restore.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(v2): lint against storage that isn't scoped to the user

Adds romm/no-unscoped-local-storage, which rejects raw localStorage and
vueuse's useLocalStorage/useStorage outside frozen v1, so new stored
preferences go through useUserLocalStorage/userStorage. The locale read
at module load stays unscoped with an inline disable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-04 09:47:02 -04:00
..
2024-07-02 12:23:41 +02:00
2025-09-03 10:18:08 -04:00