Skip to content

Integration mutations and cached connector state outlive session replacement #3331

Description

@Chris0Jeky

Summary

frontend/taskdeck-web/src/store/integrationStore.ts has a manual $reset(), but no production caller resets it during logout/session replacement. Its register/update/delete/enable/disable requests also retain permission to patch the connector cache, selected detail, error and toast after reset or account replacement.

This is a source-traced successor to #3327 / PR #3329. Keep it separate: #3329 establishes list/detail read ownership and a trustworthy reset boundary; this issue owns wiring that boundary to session lifecycle plus mutation settlement. Do not widen or retarget #3329 for it.

Reachable behavior

  1. Account A loads connector list/detail or begins a mutation.
  2. Logout clears the session and routes to Login. AppShell resets workspace, capture and board stores, but does not instantiate/reset the integration store.
  3. The integration Pinia instance retains account-A connectors until a later successful fetch replaces them.
  4. A late register/update/delete/enable/disable response can still patch that cache and emit success/error UI after logout or during account B.

Same-ID reuse makes update/delete particularly unsafe for client truth: a late account-A settlement can modify or remove an account-B row with the same connector ID after a new list is installed.

This is client-state/session isolation. It is not evidence of a server authorization bypass or rollback of a server effect accepted before logout.

Expected contract

  • Session identity/auth/demo replacement synchronously invalidates integration reads and mutations before clearing visible connector state.
  • App lifecycle owns a real production reset path; do not rely on a test-only $reset() call.
  • Every mutation captures the initiating lifecycle epoch. Stale success/failure may settle to its original caller but cannot patch connectors/detail, clear or set shared error/loading, or emit toast into the replacement session.
  • A stale delete cannot remove a same-ID connector loaded for the new session; stale update/enable/disable cannot overwrite it; stale register cannot append.
  • Server effects already accepted before logout are not represented as cancelled or rolled back.
  • Mutation ordering within one live session is assessed explicitly. If concurrent same-connector writes remain allowed, document why their server/client convergence is safe; otherwise track/implement serialization separately.

Acceptance

  • Real Pinia deferred-promise regressions for register, update and delete across logout/reset and subsequent same-ID state installation.
  • Late success and late failure both produce no replacement-session toast/error/cache mutation.
  • Logout followed by login as the same user ID still invalidates the earlier request lifetime.
  • Production logout/session path clears loaded connectors even when the Integrations view is not mounted.
  • Existing fix(integrations): bind connector reads to request lifetimes #3329 A→B→A/list ownership tests, demo behavior and ordinary successful mutation tests remain green.
  • Frontend lint, typecheck, build, full Vitest and exact-head hosted CI pass.

Dependency and provenance

Depends on #3329’s read/reset ownership primitive. Found during fresh-context review of that exact patch and AppShell.vue logout wiring on 2026-09-21. Searches for open integration-store mutation/session issues found no matching tracker.

Activity

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

    bugSomething isn't workingfrontendPrimary implementation impact in Vue/TypeScript UI and client runtime.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions