fix: return ISO8601 session expire from updateSession - #12891
Conversation
Wrap expire and providerAccessTokenExpiry with DateTime::formatTz so PATCH /account/sessions matches GET and create-session responses (appwrite#8447).
Greptile SummaryThis PR fixes an inconsistency in the
Confidence Score: 5/5Safe to merge — the change is a targeted two-line fix that aligns the update path with the already-established create-session pattern throughout the same file. Both changed lines follow the exact same DateTime::formatTz(DateTime::addSeconds(...)) idiom used by every other session-creation path in account.php. The accompanying test explicitly validates the ISO8601 format for both the PATCH response and the subsequent GET. Files Needing Attention: No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into fix-8447-sessio..." | Re-trigger Greptile |
What does this PR do?
Fixes #8447 by wrapping
expireandproviderAccessTokenExpirywithDateTime::formatTz()inPATCH /v1/account/sessions/:sessionId.Previously,
updateSessionreturned the DB datetime format (Y-m-d H:i:s.v) fromDateTime::addSeconds(), whileGETsession returned ISO8601 via the datetime decode filter. Create-session paths already usedformatTz; this aligns update with that pattern so SDK clients can deserializeexpireconsistently.Test Plan
testRefreshEmailPasswordSessionto assert PATCH (and subsequent GET)expireis ISO8601 viaDatetimeValidatorandY-m-d\TH:i:s.uPdocker compose exec appwrite vendor/bin/phpunit --filter testRefreshEmailPasswordSession(passed)Related PRs and Issues
Checklist