Skip to content

Conversation

@tusharpandey13
Copy link
Contributor

@tusharpandey13 tusharpandey13 commented Nov 17, 2025

Description

This PR fixes an issue where the beforeSessionSaved hook was not receiving the refreshed token set after a token refresh operation.

Changes

  • Pass sessionChanges to finalizeSession so the beforeSessionSaved hook receives the refreshed tokens
  • Simplify the session saving logic by merging changes before finalization
  • Add comprehensive tests to verify:
    • beforeSessionSaved hook receives refreshed accessToken
    • Changes made in beforeSessionSaved hook are properly honored

Related PRs

Testing

All existing tests pass, plus 2 new test cases:

✓ should provide the refreshed accessToken to beforeSessionSaved hook
✓ should honor changes made to the tokenSet in beforeSessionSaved hook

Co-authored-by: Wolfgang Goedel wgoedel@gmail.com

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.38%. Comparing base (50d25c1) to head (5e8d99f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2414      +/-   ##
==========================================
- Coverage   90.39%   90.38%   -0.02%     
==========================================
  Files          39       39              
  Lines        4488     4481       -7     
  Branches      911      912       +1     
==========================================
- Hits         4057     4050       -7     
  Misses        425      425              
  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.

nandan-bhat
nandan-bhat previously approved these changes Nov 17, 2025
)

- Pass sessionChanges to finalizeSession so beforeSessionSaved hook receives refreshed tokens
- Add tests to verify beforeSessionSaved hook receives refreshed accessToken
- Add tests to verify changes made in beforeSessionSaved hook are honored

Co-authored-by: Wolfgang Goedel <wgoedel@gmail.com>
@tusharpandey13 tusharpandey13 merged commit df23995 into main Nov 17, 2025
9 checks passed
@tusharpandey13 tusharpandey13 deleted the fix/before-session-saved-hook branch November 17, 2025 04:21
@tusharpandey13 tusharpandey13 mentioned this pull request Nov 17, 2025
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.

4 participants