Describe the bug
After a couple of days of PC being off, Gmail won't synchronize.
Expected behavior
When Gmail token expires it has to be refreshed.
Additional context
Happens because IsExpired returns false, but Gmail refuses the token.
It could be this issue: https://github.com/praeclarum/sqlite-net/issues/217 (I'm in UTC-7)
Basically to correctly preserve timezone (UTC in this case) when storing timestamp in SQLite-net one must use DateTimeOffset. Although I tried a roundtrip, and the comparison with incorrect kind seems to work correctly.
But actually since there's GmailClientMessageHandler it could check the return code, and force token regeneration on Unauthorized (I would suggest to only do it once per request). Should be doable by adding response handler with messageHandler.AddUnsuccessfulResponseHandler(new ...()); in GmailSynchronizer constructor.
Describe the bug After a couple of days of PC being off, Gmail won't synchronize.
Expected behavior When Gmail token expires it has to be refreshed.
Additional context Happens because
IsExpired
returnsfalse
, but Gmail refuses the token.It could be this issue: https://github.com/praeclarum/sqlite-net/issues/217 (I'm in UTC-7) Basically to correctly preserve timezone (UTC in this case) when storing timestamp in SQLite-net one must use DateTimeOffset. Although I tried a roundtrip, and the comparison with incorrect kind seems to work correctly.
But actually since there's
GmailClientMessageHandler
it could check the return code, and force token regeneration on Unauthorized (I would suggest to only do it once per request). Should be doable by adding response handler withmessageHandler.AddUnsuccessfulResponseHandler(new ...());
inGmailSynchronizer
constructor.