Repository navigation
Conversation
Match clerk-ios#576: the SDKs expose no session-lifetime API. A session with no maximum lifetime has expireAt == 0L. Document that zero means no deadline on expireAt and abandonAt, and assert zero deadlines directly, including for revoked sessions and through the cached client codec. BREAKING CHANGE: Session.hasMaximumLifetime, added in 1.3.0, is removed. Check expireAt == 0L instead. Part of MOBILE-517
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Pull request was closed
What & why
Breaking change: this removes
Session.hasMaximumLifetime, which shipped in 1.3.0 (#960). To tell whether a session has a maximum lifetime, checksession.expireAt == 0L. Zero means no maximum lifetime.This matches iOS, where clerk/clerk-ios#576 added no new API and pinned zero deadlines with tests and doc comments. The SDKs will not expose
hasMaximumLifetime, so Android drops it too.Session.hasMaximumLifetimeand itsapi.apientry are gone.expireAtsays zero (the Unix epoch) means no maximum lifetime. A response that omitsexpire_ator sendsnullstill decodes as zero.abandonAtsays zero means no abandonment deadline.SessionLifetimeTestnow asserts the deadlines directly, mirroring iOS'sSessionLifetimeTests:expire_atandabandon_atdecode as0Lon an active session;nullexpire_atdecodes as zero;CachedClerkState, the client cache codec thatClientStateStore.saveuses.ClerkApi.jsondoes not encode defaults, so the cache omitsexpire_at(its default is0L) and writesabandon_atas0. Both restore as0L.Nothing in the SDK compares
Session.expireAtwith the current time, so a zero deadline is never treated as expired. Token refresh uses the session token's own expiry.Part of MOBILE-517. Companions: clerk/clerk-ios#576, #960, clerk/javascript#9871.
Release notes
Under Breaking changes:
Session.hasMaximumLifetimeis removed. Usesession.expireAt == 0Lto detect a session with no maximum lifetime.Screenshots / video
No UI changes. Not run on a device. This machine has no Clerk Platform API key for the verification workspace, and the verify skill needs one to create the test instance, locally or on a CI runner. The change removes a getter that nothing in the SDK or the
:e2ehost calls and rewords KDoc, so no runtime behavior changes. The unit tests above cover the decoding and cached-client paths that zero deadlines take.Checked locally:
spotlessCheck,detekt,:source:api:detektDebug,:source:api:lint,:source:api:testDebugUnitTest, andapiCheck.Summary by CodeRabbit
nullexpiration timestamps decode with a value of zero. Zero timestamp values are preserved when sessions are cached and restored.hasMaximumLifetimesession property.