Skip to content
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

[Bug] Gmail authentication does not work after a period of being offline #447

Open
lostmsu opened this issue Oct 21, 2024 · 0 comments · May be fixed by #448
Open

[Bug] Gmail authentication does not work after a period of being offline #447

lostmsu opened this issue Oct 21, 2024 · 0 comments · May be fixed by #448
Assignees
Labels
bug Something isn't working

Comments

@lostmsu
Copy link

lostmsu commented Oct 21, 2024

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: praeclarum/sqlite-net#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.

@lostmsu lostmsu added the bug Something isn't working label Oct 21, 2024
lostmsu added a commit to lostmsu/Wino-Mail that referenced this issue Oct 21, 2024
lostmsu added a commit to lostmsu/Wino-Mail that referenced this issue Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants