[FIX] includeExpired set to false should not automatically return null #397
[FIX] includeExpired set to false should not automatically return null #397rafaelsorto wants to merge 1 commit intoShopify:mainfrom
Conversation
|
I have signed the CLA! |
|
hey @rafaelsorto, thanks for your contribution. Could you please add a test? |
Hey @Arkham I see that the tests are passing even with the previous code and also pass with my changes. Looking further into this it seems the only change is that isValid is not actually checked if you pass The default includeExpired check for a valid token, but the validity check does 3 things at once, checks the scope, checks the access_token and checks the date, includeExpired set to true avoids the expiration check but also avoids the other 2 checks at the same time. |
|
Yeah, what I'm suggesting is that you add a new test that would fail with the existing code, then it should pass when we change the implementation. |
includeExpired set to false is incorrectly forcing the loadOfflineSession method to always return null. Offline sessions should not be considered invalid automatically if they don't have an expiration date and the property should be used in the valid check to discard expired sessions.
WHY are these changes introduced?
Bug not reported for this issue. Identified on production.
Offline sessions not used even when they exist and token is valid
WHAT is this pull request doing?
Type of change
Checklist