Skip to content

Notifications: optimistically update stored notification's read status #406

@bummytime

Description

@bummytime

Adding this issue based on @jleandroperez's comments in this PR here.

In WPiOS we do a bit of a special treatment here. The scenario that prompted this was (afaik somehow) like this:

  1. Slow connection
  2. Notifications list gets onscreen
  3. User pushes the Details for "Notification A"
  4. Back to the Notes List
  5. [Time Elapsed]
  6. "Mark as Read" result comes back

At that point you'd see, out of the blue, the notification getting marked as read. What we do, to attempt to improve the UX, is to optimistically update the Stored Notification.

That way, when you hit (4), the note is "marked as read" locally.

If the remote call fails, we simply invalidate the cache (just set an invalid Note.hash value). This way, next time we sync, the "Optimistic OP" would be reverted.

WPiOS sample code here

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions