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

[HOLD for payment 2024-03-14] HIGH: Onyx updates from push notifications can get applied out of order #33191

Closed
arosiclair opened this issue Dec 15, 2023 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@arosiclair
Copy link
Contributor

arosiclair commented Dec 15, 2023

Note: Waiting for #34082 to build the troubleshooting tools

Problem

When a user receives a report comment, we send them a push notification for it. The notification payload contains Onyx updates for the report and the new report action. We apply those onyx updates here and call ReconnectApp in the background using backgroundRefresh.

There is a chance this update gets applied out of order eg:

  1. User A sends a message and edits it quickly
  2. User B applies updates for the new message and edit from Pusher
  3. User B receives a delayed push notification for the message and applies the update for the original un-edited message

Why is this important?

If this happens, the report and report action data will stay out of date until the next updates are received

Solution

Start including lastUpdateID and previousUpdateID in the notification payload and use those to apply the update like we do for reliable updates here so those updates always get applied in order.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018a77e81664929acf
  • Upwork Job ID: 1735753015692898304
  • Last Price Increase: 2023-12-15
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@arosiclair arosiclair added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Bug Something is broken. Auto assigns a BugZero manager. labels Dec 15, 2023
@arosiclair arosiclair self-assigned this Dec 15, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

Job added to Upwork: https://www.upwork.com/jobs/~018a77e81664929acf

Copy link

melvin-bot bot commented Dec 15, 2023

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Dec 15, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 15, 2023

Triggered auto assignment to Contributor Plus for review of internal employee PR - @allroundexperts (Internal)

Copy link

melvin-bot bot commented Dec 19, 2023

@JmillsExpensify, @arosiclair, @allroundexperts Whoops! This issue is 2 days overdue. Let's get this updated quick!

@arosiclair
Copy link
Contributor Author

No progress on this yet. I'm heads down on Notification Polish and then OOO for a couple days. I should be able to get to this next week.

@melvin-bot melvin-bot bot removed the Overdue label Dec 19, 2023
@arosiclair arosiclair added Weekly KSv2 and removed Daily KSv2 labels Dec 19, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Dec 20, 2023
@mallenexpensify
Copy link
Contributor

@allroundexperts can you review the PR?
#33371

I think you might not have been auto-assigned cuz of the formatting here? (reallly don't know, just trying to expedite a fix here)

Related to #33191 and https://expensify.slack.com/archives/C049HHMV9SM/p1703005526338499

@allroundexperts
Copy link
Contributor

Sure, thanks for the reminder!

@quinthar quinthar changed the title Onyx updates from push notifications can get applied out of order HIGH: Onyx updates from push notifications can get applied out of order Dec 26, 2023
@arosiclair arosiclair added Daily KSv2 and removed Reviewing Has a PR in review Weekly KSv2 labels Dec 26, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Feb 9, 2024
@arosiclair
Copy link
Contributor Author

arosiclair commented Feb 12, 2024

Realized I still had to handle whisper messages. Just finished handling that case. Now I have a test failing in CI but not locally 🙃. I'm going to reach out in #engi-chat on how to get that fixed. Figured it out! Auth and Web-E PR's are out for review. App is held until those are deployed.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Feb 12, 2024
@arosiclair
Copy link
Contributor Author

  • Auth PR is deployed
  • Web-E PR is ready for review & merge
  • App PR will be ready for testing once the Web-E is deployed

@iwiznia
Copy link
Contributor

iwiznia commented Feb 19, 2024

Nice, super excited for this to go out. Thanks for the hard work on it! ❤️

@arosiclair
Copy link
Contributor Author

All PR's are now merged. Just waiting for the App PR to hit staging so I can QA. ETA is EOW.

@arosiclair arosiclair added Daily KSv2 and removed Reviewing Has a PR in review Weekly KSv2 labels Mar 6, 2024
@arosiclair
Copy link
Contributor Author

QA on staging passed! This should be out on prod in the next deploy. ETA is today/tomorrow.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Mar 7, 2024
@melvin-bot melvin-bot bot changed the title HIGH: Onyx updates from push notifications can get applied out of order [HOLD for payment 2024-03-14] HIGH: Onyx updates from push notifications can get applied out of order Mar 7, 2024
Copy link

melvin-bot bot commented Mar 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.48-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-03-14. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Mar 7, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@allroundexperts] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@arosiclair
Copy link
Contributor Author

This wasn't really a regression just new functionality for reliable updates.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 14, 2024
Copy link

melvin-bot bot commented Mar 14, 2024

Payment Summary

Upwork Job

BugZero Checklist (@JmillsExpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1735753015692898304/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added the Overdue label Mar 18, 2024
@JmillsExpensify
Copy link

The payment summary above is correct, so @allroundexperts please add this one to your next round of Expensify requests. Closing in the meantime.

@melvin-bot melvin-bot bot removed the Overdue label Mar 19, 2024
@github-project-automation github-project-automation bot moved this from HIGH to CRITICAL in [#whatsnext] #vip-vsb Mar 19, 2024
@joekaufmanexpensify
Copy link
Contributor

Stepping in for payment summary for Jason. Only payment is $500 to @allroundexperts for PR review. Paid via NewDot.

@JmillsExpensify
Copy link

Thanks! $500 approved for @allroundexperts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
No open projects
Status: CRITICAL
Development

No branches or pull requests

7 participants