Skip to content

fix(api): drop zero session deadline handling from Session - #1175

Merged
swolfand merged 1 commit into
mainfrom
sam/drop-zero-session-deadline-docs
Oct 23, 2026
Merged

swolfand merged 1 commit into
mainfrom
sam/drop-zero-session-deadline-docs

Conversation

@swolfand

@swolfand swolfand commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What & why

The backend now gives indefinite native sessions the same far-future deadline as the web "maximum lifetime off" setting (ExpiryTimeMax), so expire_at is never 0. This restores Session.expireAt to its form before #960: required, with no default and no epoch-zero docs. It also removes SessionLifetimeTest, which only covered zero deadlines.

hasMaximumLifetime was already removed in #1165. Part of MOBILE-517.

Checks

spotlessCheck, apiCheck (no API dump change), api unit tests, ui unit-test and e2e compile.

Screenshots / video

No UI or runtime change for responses the backend sends, so there is nothing to show on a device.

Summary by CodeRabbit

  • Changes
    • Session expiration timestamps must now be provided explicitly; they are no longer implicitly set to zero when omitted. Applications that create session data without an expiration timestamp may need to update their inputs.

The backend now gives indefinite native sessions the same far-future deadline as the web 'maximum lifetime off' setting, so expire_at is never 0. Restore Session.expireAt to its required form and remove the zero-deadline docs and tests.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 618bb6d and 8e79276.

📒 Files selected for processing: 2
  • source/api/src/main/kotlin/com/clerk/api/session/Session.kt
  • source/api/src/test/java/com/clerk/api/session/SessionLifetimeTest.kt
💤 Files with no reviewable changes: 1
  • source/api/src/test/java/com/clerk/api/session/SessionLifetimeTest.kt

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

📝 Walkthrough

The Session.expireAt constructor property no longer has a default value, so callers must provide it. The SessionLifetimeTest class and its session lifetime decoding and serialization tests were removed.

Changes: Session expiration contract

Layer / File(s) Summary
Require an explicit expiration value
source/api/src/main/kotlin/com/clerk/api/session/Session.kt, source/api/src/test/java/com/clerk/api/session/SessionLifetimeTest.kt
Session.expireAt no longer defaults to 0L, and related documentation was removed. The lifetime test class, including decoding and serialization tests, was deleted.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: mikepitre

Merge Risk: ⚪ Minimal · up to 8e792

No concrete merge-blocking risk was established by the reviewed change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: it removes zero-deadline handling from Session, which matches the raw summary (expireAt becomes a required Long with no default, and the zero-deadline docs are removed…
Description check Passed The description follows the template. 'What & why' explains the backend change that gives indefinite native sessions a far-future deadline, which makes expire_at never 0, and it links the ticket. It a…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: it removes zero-deadline handling from Session, which matches the raw summary (expireAt becomes a required Long with no default, and the zero-deadline docs are removed). It is specific and follows the conventional commit style. The title does not mention the deleted SessionLifetimeTest, but that is secondary.

Full details: Description check

Explanation

The description follows the template. 'What & why' explains the backend change that gives indefinite native sessions a far-future deadline, which makes expire_at never 0, and it links the ticket. It also states that SessionLifetimeTest was removed and gives the checks that were run. The 'What to focus on' section is missing. It is optional because the change is small, but the author should either add it or delete it, as the template suggests. The Screenshots section is filled in.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@swolfand
swolfand merged commit a9789b4 into main Oct 23, 2026
16 checks passed
@swolfand
swolfand deleted the sam/drop-zero-session-deadline-docs branch October 23, 2026 17:03
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.

1 participant