Closed poovamraj closed 12 months ago
Wasn't the Z escaped in this PR: https://github.com/auth0/auth0-flutter/pull/238?
In fact, we requested the escaped format:
Are we sure this change won't re-introduce this issue? https://github.com/auth0/auth0-flutter/issues/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
format.timeZone = TimeZone.getTimeZone("UTC")
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
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
0186ee5
) 95.88% compared to head (4ece863
) 95.79%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Great! Can we release it also on pub.dev ?
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
https://github.com/auth0/auth0-flutter/issues/286 https://github.com/auth0/auth0-flutter/pull/162 https://github.com/auth0/auth0-flutter/compare/v1.0.1...main
π― Testing
Existing unit test has been fixed to avoid this issue