-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix access token expiry android #315
Conversation
Wasn't the Z escaped in this PR: #238? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a fix we are looking for 👍
In fact, we requested the escaped format: Are we sure this change won't re-introduce this issue? #160 |
Yes, escaping it would be the right thing. But while we escaped the timezone "Z" which will parse the date to local time, we have forgotten to remove
Also this would have caused issues for API login and other places since it was set only here and not in the other places where we format date |
It'd be great to have a single date formatter (or format string) in the entire Android native layer, to avoid these kinds of issues. |
This fixes the token refesh issue for me. Please merge it |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #315 +/- ##
==========================================
- Coverage 95.88% 95.79% -0.09%
==========================================
Files 75 76 +1
Lines 1117 1118 +1
Branches 281 281
==========================================
Hits 1071 1071
- Misses 45 46 +1
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Great! Can we release it also on pub.dev ? |
We're needing this released as well as it's affecting our users |
👋🏼 I expect to cut a release by EOW. |
📋 Changes
This error is happening because in Java we were parsing the credentials result as Z which refers to timezone parsing in Java
But this was later changed to escape as shown below.
This means we were initially parsing the timestamp as UTC at the dart layer when credentials were retrieved and to be same as that we had to set timezone while saving the credentials.
But after that we have removed parsing timezone by escaping the Z with quotes
''
. But we haven't removed the timezone being set in save credentials handler. This caused the time to jump to the offset of UTC.We have fixed this by removing the timezone in save credentials handler.
📎 References
#286
#162
v1.0.1...main
🎯 Testing
Existing unit test has been fixed to avoid this issue