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

Improve getting unread emails count for Tutanota #30

Closed
vladimiry opened this issue Jul 6, 2018 · 3 comments
Closed

Improve getting unread emails count for Tutanota #30

vladimiry opened this issue Jul 6, 2018 · 3 comments

Comments

@vladimiry
Copy link
Owner

vladimiry commented Jul 6, 2018

Tutanota currently doesn't provide a convenient option to get unread count value not producing additional request to the server, but listening only. Hopefully it will be improved after the tutao/tutanota#234 and tutao/tutanota#229 issues resolving. I presume unread value will be provided by backend as a stream.

As for now, getting unread emails count in this app for Tutanota is done as Rest API polling, interval is 60 seconds. Checking of only the most 50 recent messages is happening and only in the inbox folder. So If there are unread messages, then it will be shown by app, but possible older unread messages or messages in other folders will not be taken into the account. Number 50 can be increased, but that will increase load on Tutanota Rest API.

@vladimiry
Copy link
Owner Author

vladimiry commented Jul 8, 2018

Looks like app can listen for "instanceId": "someid", "operation":"1","type":"Mail" event batch action happening, then load a single/updated mail entity by instanceId and get unread state from it. It might also be possible to intercept related web client activity, as web client already subscribed to event batch stream. In that case there will be no need in polling requests. That would mean getting closer to a passive/listening mode - not producing addition requests to a server.

@vladimiry
Copy link
Owner Author

I'm considering to backup getting unread count feature by a local account cache, if such cache is enabled for the account, see details here. Since app can derive the unread count values from the database for free, for all the folders, with no emails scanning limit, and almost instantly.

@vladimiry
Copy link
Owner Author

Issue has been resolved with v2.0.0-beta.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant