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

Comments

Projects
None yet
1 participant
@vladimiry
Copy link
Owner

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

This comment has been minimized.

Copy link
Owner Author

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

This comment has been minimized.

Copy link
Owner Author

commented Sep 6, 2018

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

This comment has been minimized.

Copy link
Owner Author

commented Sep 25, 2018

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
You can’t perform that action at this time.