Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.48k stars 2.84k forks source link

CRITICAL: Inconsistent Summary Notifications for different users in the same room #33685

Closed marcochavezf closed 9 months ago

marcochavezf commented 9 months ago

Problem

Coming from this comment in that PR, we're using the rNVP NVP_LAST_NOTIFIED_REPORT_ACTION_TIMESTAMP to save the timestamp of the last report action when we either run NotifyOfflineUsersAboutActivity or NotifyReportDailyDigest. And the problem is that we're using that rNVP value to get the messages after that timestamp here to send them as notification to the user, but that value is set at report level and not at the user level causing inconsistent summary messages for different users in the same room. i.e. if a comment is marked as read for an userA, the daily summary for userB will be the messages accumulated after the message that userA read or their daily summary was sent.

Testing steps:

  1. Alice creates a workspace
  2. Alice creates a workspace room named #test
  3. Alive invites bob@bagels.com and cathy@croissants.com to the #test room
  4. Cathy sets the preference to Daily (Click/tap on room avatar > Settings > Notify me about new messages > Daily)
  5. Cathy logs out
  6. Alice posts "Hello everyone!"
  7. Bob opens the room immediately and sees the message

Expected result:

  1. Bob and Cathy immediately get a summary with:
    1. Alice invited @bob@bagels.com and cathy@croissants.com
  2. 1 day later Cathy gets a summary email with (alternatively force run the job *NotifyReportDailyDigest?reportID=<reportID>* from BJM):
    1. Hello everyone!

Actual result:

  1. Bob and Cathy immediately get a summary with:
    1. Alice invited @bob@bagels.com and cathy@croissants.com
  2. Cathy never receives the summary email with the subsequent message
quinthar commented 9 months ago

For this, didn't Cathy already see her invite message in the first email? Why would she see it again 10 minutes later?

image
marcochavezf commented 9 months ago

Ah yes, she shouldn't see the invite, just the subsequent message "Hello everyone!". I will update the steps. Also, this happens more consistently with preferences set to Daily.

marcochavezf commented 9 months ago

Hmm the issue wasn't closed after being deployed to production https://github.com/Expensify/Web-Expensify/pull/40300#issuecomment-1872010221