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

Message read status not syncing properly on mobile #8041

Closed
8 of 10 tasks
JSkier21 opened this issue Nov 26, 2024 · 6 comments · Fixed by #8153
Closed
8 of 10 tasks

Message read status not syncing properly on mobile #8041

JSkier21 opened this issue Nov 26, 2024 · 6 comments · Fixed by #8153
Labels
android issues that concern the android client but not all clients bug broken functionality, usability problems, unexpected errors ios issues that concern the ios client but not all clients state:tested We tested it and are about to release it
Milestone

Comments

@JSkier21
Copy link

JSkier21 commented Nov 26, 2024

  • [ ✔️ ] This is not a feature request (existing functionality does not work, not missing functionality).
    I will request features on forum or via support.
  • [ ✔️ ] I've searched and did not find a similar issue.

Bug in mobile app

Describe the bug
Message read status across iOS devices is not syncing with the web application, very delayed or broken. This appears to be one way, for example, if I click mark the message as read on iOS, it will almost instantly show up in the web application on the browser. However, this is not the case at all when marking a message read in the browser to iOS devices. Note, I do have a couple of dozen mailbox rules, and also folders. Quitting and restarting the iOS app a couple of times gets things to sync in the root inbox, however, not the case with any folders I can see.

I have tried leaving the app open, previously hoping things would sync, It's been several hours, and they don't until I manually mark them as read in iOS.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Tuta web application. Find a folder with a few unread messages on it. Mark them as read
  2. Open the Tuta iOS app, let it connect and allegedly sync
  3. Check the folder where you marked messages read on the web, they will be out of sync and likely show many of those messages as unread, despite the contrary from all being marked as read in the web application

Expected behavior
Inbox and folders should sync relatively quickly across platforms. When I mark a message as read in the web applications, it should show up relatively quickly as marked read on iOS devices.

Changes strictly made on Apple devices, do, in fact, sync the read status correctly. With the web application, I would expect changes in the browser to sync across to iOS. However, they do not.

Screenshots
Web application showing messages as marked as read (red = read, Freudian slip 😅):
image
iOS application, same folder, showing 3 of the same messages marked as unread (note that badge count is accurate at zero though):
image

Smartphone (please complete the following information):

  • Device: iPhone 15, iPad Mini, computer web browser
  • OS: iOS 18.1.1 on both devices, latest Firefox and Chrome with Tuta app up-to-date as of 11/26/24
  • Version: Tuta 253.241126.2 (problem has been ongoing with previous versions for a few weeks, working with support on this)

Additional context
Other than the above, not much else I have, happy to provide any details if you ask.

Test notes

  • Have the same account on two clients, one being on mobile, the other on desktop or web.
  • Make sure mobile is logged out.
  • From desktop or web send an email to yourself and mark it as read.
  • Login on mobile and see that email has the correct read status.
    • When mail is within cached range (most cases).
    • When mail is outside cached range. This happens when the mail belongs to a newly created mail bag with mail list that is not cached by the client (might be easier to test this locally by reducing mailbag's max size).
      • Again, make sure mobile client is logged out.
      • From desktop, send multiple mails until current mail bag limit is reached and a new mail bag is created.
      • From desktop mark a few mails from new mail bag as read.
      • Login on mobile and see mails have the correct read status.
@JSkier21 JSkier21 added the bug broken functionality, usability problems, unexpected errors label Nov 26, 2024
@BijinDev BijinDev added android issues that concern the android client but not all clients ios issues that concern the ios client but not all clients labels Dec 12, 2024
@paw-hub
Copy link
Contributor

paw-hub commented Dec 12, 2024

We did some testing.

This occurs on both Android and iOS because we directly insert Mail instances into the cache from native. Since we don't update ranges on insertion, this Mail instance is outside of the our cached range (thus storage.isElementIdInCacheRange returns false from DefaultEntityRestCache#processCreateEvent), and thus we don't try to redownload the mail. As a result, the Mail instance may not get marked as read if you read it on another client.

@charlag
Copy link
Contributor

charlag commented Dec 16, 2024

We did debug a bit more and we were puzzled why email is not in the cached range since mail indexer does use that range and OfflineStorageCleaner does not delete those lists completely (whether it should is another question).

We found one such case: when there's a new mail bag, the app would not a cached range for it since it never did mail indexing for it.

We experimented with adding a fallback check for a single entity but it adds ~3ms delay on Android and ~8ms delay on desktop for each entity update which quickly adds up and we don't think that we want to go with this solution.

We are trying to think of more options, e.g. storing this not as a mail entity but they all have drawbacks.

@charlag charlag pinned this issue Dec 16, 2024
hrb-hub added a commit that referenced this issue Dec 17, 2024
Notification process on mobile does insert Mail instances into offline
db in order to show the mail preview as quickly as possible when the
user clicks on notification. In most cases it happens before login, and
it happens independently of entity update processing.

EntityRestCache does only download new list element instances when
they are within the cached range. In most cases new mails are within the
cached range as mail indexer caches mail bag ranges during initial
indexing. However, if the mail bag size has been reached there will be a
new mail bag with mail list that is not cached by the client (there is
no range stored for this new list).

EventQueue optimizes event updates. If CREATE event is followed by an
UPDATE event they will be folded into a single CREATE event.

In a situation where the email has been updated by another client after
it has been inserted into offline db by notification process but before
the login, and that email belongs to uncached mail bag, CREATE event
(and optimized away UPDATE events) for that mail would be skipped and
the user would see an outdated Mail instance.

We changed the behavior for Mail instances to be always downloaded on
CREATE event when we use Offline cache so that we do not miss those
update operations. This was the previously expected behavior because
of mail indexing and is also a common behavior now, until new mail bag
is created so it does not lead to additional requests in most cases.

Alternatively we could check if the (new) instance is already cached as
individual instance. We decided against that as it adds the delay to
event processing and also does not fit the logic of processing (why
should cache check if new instance is already cache?).

In the future we should try to optimize loading of new instances so
that the sync time does not increase from downloading single emails.

Close #8041

Co-authored-by: ivk <ivk@tutao.de>
@hrb-hub hrb-hub linked a pull request Dec 17, 2024 that will close this issue
@charlag charlag added this to the Next client release milestone Dec 18, 2024
@charlag charlag changed the title Message read status not syncing properly with web client in iOS, most notable in folders Message read status not syncing properly on mobile Dec 18, 2024
@wrdhub wrdhub self-assigned this Dec 18, 2024
@wrdhub wrdhub added the state:tested We tested it and are about to release it label Dec 18, 2024
@wrdhub wrdhub removed their assignment Dec 18, 2024
BijinDev pushed a commit that referenced this issue Dec 20, 2024
Notification process on mobile does insert Mail instances into offline
db in order to show the mail preview as quickly as possible when the
user clicks on notification. In most cases it happens before login, and
it happens independently of entity update processing.

EntityRestCache does only download new list element instances when
they are within the cached range. In most cases new mails are within the
cached range as mail indexer caches mail bag ranges during initial
indexing. However, if the mail bag size has been reached there will be a
new mail bag with mail list that is not cached by the client (there is
no range stored for this new list).

EventQueue optimizes event updates. If CREATE event is followed by an
UPDATE event they will be folded into a single CREATE event.

In a situation where the email has been updated by another client after
it has been inserted into offline db by notification process but before
the login, and that email belongs to uncached mail bag, CREATE event
(and optimized away UPDATE events) for that mail would be skipped and
the user would see an outdated Mail instance.

We changed the behavior for Mail instances to be always downloaded on
CREATE event when we use Offline cache so that we do not miss those
update operations. This was the previously expected behavior because
of mail indexing and is also a common behavior now, until new mail bag
is created so it does not lead to additional requests in most cases.

Alternatively we could check if the (new) instance is already cached as
individual instance. We decided against that as it adds the delay to
event processing and also does not fit the logic of processing (why
should cache check if new instance is already cache?).

In the future we should try to optimize loading of new instances so
that the sync time does not increase from downloading single emails.

Close #8041

Co-authored-by: ivk <ivk@tutao.de>
@alstr
Copy link

alstr commented Dec 20, 2024

Possibly related to the long-standing issue #4265

Offline mode in general is very brittle and the local database seems to get corrupted very easily, leading to inconsistencies between devices.

@JSkier21
Copy link
Author

I'm still having issues on the latest iOS version, 259.241213.0. The workaround is to set the cache to 0, which means no offline mode. It's very reproducible, set cache to 2 days (or however many), and it doesn't sync read status correctly across devices for that period of time set.

I wanted to add, as a paying customer, I worked with support initially on this. They were very dismissive, and didn't have much desire to work on this. This is very frustrating to see that Tuta seems to be focused on heavy marketing, and making more products (a separate calendar, for example), when they should be focusing on the core, making the existing e-mail service reliable and solid enough to work as expected.

@alstr
Copy link

alstr commented Dec 20, 2024

I wanted to add, as a paying customer, I worked with support initially on this. They were very dismissive, and didn't have much desire to work on this. This is very frustrating to see that Tuta seems to be focused on heavy marketing, and making more products (a separate calendar, for example), when they should be focusing on the core, making the existing e-mail service reliable and solid enough to work as expected.

100%. Support only seem to be interested in workarounds and the outlook of Tuta is almost entirely focused on the 'next big thing'. I know this is not directly related to the issue at hand, so I won't go into it further - but previous constructive efforts have felt like shouting into the void anyway, and patience is wearing thing. #4265 is years old and hasn't had a Tuta response since 2023.

@hrb-hub
Copy link
Contributor

hrb-hub commented Dec 20, 2024

Hi @JSkier21
Your frustration is understandable. Please note that the fix is actually coming with v259.241218.0 and later
It should have been released already, but due to a few CI issues it has been delayed to next week.

Sorry for the inconvenience 🙏 and happy holidays :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android issues that concern the android client but not all clients bug broken functionality, usability problems, unexpected errors ios issues that concern the ios client but not all clients state:tested We tested it and are about to release it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants