Skip to content

Replacing a same-class bearer retains an old role and leaves the Telegram card idle #760

Closed

Description

@lumenpearson

Failure scenario

While the account page stays open, rejoining the same class replaces its token. The identity observer resets the live link to Idle, but the account refresh effect is keyed only by class ID, so no replacement fetch starts. The card stays at «Проверяю привязку…» without a retry control. The persisted role is also keyed only by class ID: an old administrator role can still expose management affordances for the new unlinked bearer. Server authorization still protects writes; this is not a server permission bypass.

Source a86f0ce: SettingsViewModel.kt205, SettingsScreen.kt200, LessonsPreferences.kt402. Existing replacement tests omit a persisted manager role or manually start the successor refresh. The independent review and source tracing identify the missing ownership keys; the new behavioral witness had not run at filing.

Acceptance

  • Seed a real persisted admin role, replace the bearer without leaving Account, and reproduce old privileges/idle link before correction.
  • Cached roles are scoped to the actual server/class/bearer; stale or legacy unowned role answers cannot restore successor privileges.
  • The replacement identity gets its link code automatically while Account stays open; address changes obey the same ownership rule.
  • Focused RED/GREEN, full affected gates/counts, CI and dev/master delivery are retained with Move the remaining Android remotes to v2 transports (stage 5b) #746.

Parent #746; review finding I2 in the single corrective pass.

Corrective checkpoint — 14 November 2026

CachedRoleOwnerTest observed old roles after bearer/address replacement; SettingsViewModelTest observed the two missing automatic refreshes. The correction scopes real persisted roles to server/class/bearer and refreshes while Account stays open.

Legacy unowned roles are unknown, owner metadata reuses the existing sealed token, and a closed Account page does not refresh on later identity changes. All five persisted-role and21 SettingsViewModel cases pass.

The ONE review corrective cohort first produced82 cases/20 AssertionError failures; the same82 identities now pass. Full unfiltered Android test/both ordinary assembles/detekt passed at2202 unique cases,0failures/errors/skips. Both completed-report count validators pass at3910/2202 and168 selected document guards pass separately. No baseline growth or suppression was added. Earlier failed/green evidence remains retained.

Corrective head is 473e88af87b5a106cee660a2c7fe24b7029fd0f9 in draft PR #757. Exact-head CI43554034696 is still running at this checkpoint. CI/dev/master delivery and the broader #746 acceptance remain unfinished; this issue stays open. No re-review is planned; Minor #764/#765 remain deferred.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions