[PR #3836] [MERGED] fix: ttl sessions list expiration #30639

Closed
opened 2026-04-17 21:40:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3836
Author: @dvanmali
Created: 8/6/2025
Status: Merged
Merged: 9/25/2025
Merged by: @dvanmali

Base: canaryHead: internalAdapter


📝 Commits (2)

  • 371a85d fix: ttl expiration should mimic existing expiresAt sessions list, removes any expired
  • f7ba976 fix: item not stored during creation, expiration tests

📊 Changes

2 files changed (+180 additions, -11 deletions)

View changed files

📝 packages/better-auth/src/db/internal-adapter.test.ts (+112 -1)
📝 packages/better-auth/src/db/internal-adapter.ts (+68 -10)

📄 Description

  • Logic for ttl expiration should mimic existing expiresAt sessions list.
  • Secondary storage never added token to secondary storage when calling createSession

Partial Fix: #4034, #4472
Additional PR: #4961


Summary by cubic

Updated session list logic to remove expired sessions and set TTL based on the latest session expiration.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/3836 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 8/6/2025 **Status:** ✅ Merged **Merged:** 9/25/2025 **Merged by:** [@dvanmali](https://github.com/dvanmali) **Base:** `canary` ← **Head:** `internalAdapter` --- ### 📝 Commits (2) - [`371a85d`](https://github.com/better-auth/better-auth/commit/371a85dccf971bb5cba33ffa593b22b7ba3472ed) fix: ttl expiration should mimic existing expiresAt sessions list, removes any expired - [`f7ba976`](https://github.com/better-auth/better-auth/commit/f7ba976f1bc5d20dea9a455676b9fe6e32549d7f) fix: item not stored during creation, expiration tests ### 📊 Changes **2 files changed** (+180 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/internal-adapter.test.ts` (+112 -1) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+68 -10) </details> ### 📄 Description - Logic for ttl expiration should mimic existing `expiresAt` sessions list. - Secondary storage never added token to secondary storage when calling `createSession` Partial Fix: #4034, #4472 Additional PR: #4961 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Updated session list logic to remove expired sessions and set TTL based on the latest session expiration. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 21:40:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#30639