Skip to content

Per-account memory is stamped with a token fingerprint, so a re-sign-in by the same owner loses it #830

Description

@GLinnik21

What happens

Some per-account data is stamped with plex::grant::account_key, a fingerprint of the plex.tv account token (grant.rs:164). A token lasts only as long as one sign-in. When the same person signs in again, they get a new token and a new stamp, so their own data reads as another account's:

  • Track memory (prefs/track_memory.rs): no remembered audio or subtitle picks, and the next write prunes the old record.
  • Subtitle offsets (subtitle_offsets, MemoryEntry::ADOPTS_UNSTAMPED): the same.
  • Per-profile preferences (prefs/profile_prefs.rs, the account field): the profile falls back to the frozen top-level keys and the defaults.
  • Plaintext consent (plaintext_consent, Session::plaintext_consent): the person is asked again. The account_key doc calls this "the closed direction" on purpose. The new owner-identity design needs to decide whether consent should keep that behaviour.

A sign-out already clears all of these through ACCOUNT_BOUND_PREFERENCES. The loss described above is on a sign-in that is not a sign-out: a stored session that could not be activated, "Use another account", or a re-sign-in after a revoked token.

Proposed fix

Stamp these records with the owner's identity. That means session::owner_identity (the roster admin's plex.tv id), which the login-over-another-account check now uses, not the token. Records stamped by older builds need a migration: adopt an old record when its token stamp equals the current session's.

Code to start from:

  • grant::account_key
  • session.rs:482 and session.rs:2511
  • prefs/profile_prefs.rs
  • prefs/track_memory.rs
  • media/src/route/prefs.rs, where the media door stamps its mirror write

Tests

  • A re-sign-in by the same owner keeps all four kinds of data.
  • A sign-in by a different owner reads none of it.
  • A record stamped by an older build is adopted once.

Activity

  1. added
    subtitles
    on Oct 17, 2026
  2. added
    bug
    sign-in
    on Nov 12, 2026
  3. added theissue type on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsign-insubtitles

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions