Skip to content

fix(auth): serialize session lifecycle - #35

Open
dnlrsls wants to merge 2 commits into
feat/progress-auth-epoch-fencingfrom
feat/progress-auth-lifecycle-serialization
Open

fix(auth): serialize session lifecycle#35
dnlrsls wants to merge 2 commits into
feat/progress-auth-epoch-fencingfrom
feat/progress-auth-lifecycle-serialization

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Closes #32

PR Type

  • Bug fix

Summary

  • Serializes complete login and logout lifecycles so browser credentials and frontend identity cannot diverge.
  • Defers protected-resource and auth-check effects until the active lifecycle can safely apply them.
  • Preserves visible authentication errors while preventing stale state commits.

Changes

File Change
frontend/kanati-app/src/features/auth/services/auth.service.ts Adds lifecycle-aware request coordination.
frontend/kanati-app/src/features/auth/store/authStore.ts Serializes session lifecycle transitions and applies guarded state effects.
frontend/kanati-app/src/features/auth/store/authStore.test.ts Adds lifecycle sequencing and error-preservation coverage.
frontend/kanati-app/src/shared/lib/api-client.ts Applies lifecycle context to auth-related transport behavior.
frontend/kanati-app/src/shared/lib/api-client.test.ts Verifies lifecycle-aware request behavior.

Test Plan

  • After the timeout fix, the full frontend suite: 413 tests passed.
  • Focused auth lifecycle tests: 19 tests passed.
  • Lint passed.
  • Build passed.
  • Diff-check passed.

Contributor Checklist

  • Linked approved issue fix(auth): serialize session lifecycle #32 with a closing keyword.
  • Added exactly one type:* label: type:bug.
  • Shellcheck: not applicable — this PR changes no shell scripts.
  • Documentation: not applicable — no user-facing documentation change is required for this internal frontend fix.
  • Conventional commits are used.
  • No Co-Authored-By trailers or other attribution were added.

Chain Context

Field Value
Chain capacitaciones progress session isolation
Tracker PR Not needed
Position 2 of 3
Base feat/progress-auth-epoch-fencing
Depends on #34 — auth epoch fencing
Follow-up #36 — session query cache isolation
Review budget 398 / 400 changed lines
Starts at feat/progress-auth-epoch-fencing
Ends with Login and logout lifecycle state commits are serialized and guarded.

Chain Overview

main
└── #34 — auth epoch fencing
    └── 📍 #35 — auth lifecycle serialization
        └── #36 — session query cache isolation

Scope

  • Includes: frontend-only auth lifecycle serialization and its focused tests.
  • Excludes: backend, database, API-contract changes, and later P2-P4 work.

Autonomy

  • CI is expected to pass for this PR branch.
  • This PR has one deliverable scope.
  • This PR can be rolled back without unrelated changes.
  • Tests and verification cover this unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug bug fix PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant