Skip to content

delete redundant txn cookies impl, tests and some linting changes #2077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tusharpandey13
Copy link
Contributor

@tusharpandey13 tusharpandey13 commented May 2, 2025

Fixes: #1917

Overview

The original logout handler (handleLogout) only deleted the session cookie, leaving transaction cookies behind.
This caused potential accumulation of transaction state cookies (__txn_{state}) for users, particularly those who were unauthenticated or experienced interrupted login flows.

Changes

  • Modified AuthClient.handleLogout to actively clear all transaction cookies (matching the transaction store's cookie prefix)
  • Added a public getter method getCookiePrefix to TransactionStore
  • Added test file redundant-txn-cookie-deletion.test.ts to test this specific flow.
  • Some linting changes.

Tests

PASSING

Usage

No change in contract

@tusharpandey13 tusharpandey13 requested a review from a team as a code owner May 2, 2025 09:46
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.25%. Comparing base (c44432c) to head (af9d7b1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2077      +/-   ##
==========================================
+ Coverage   82.05%   82.25%   +0.19%     
==========================================
  Files          21       21              
  Lines        1967     1989      +22     
  Branches      343      348       +5     
==========================================
+ Hits         1614     1636      +22     
  Misses        347      347              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v4: Infinitely stacking cookies
2 participants