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-04-25] GetMissinOnyxMessages being executed several times #39992

Closed
danieldoglas opened this issue Apr 10, 2024 · 13 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 Internal Requires API changes or must be handled by Expensify staff

Comments

@danieldoglas
Copy link
Contributor

danieldoglas commented Apr 10, 2024

Problem

When we have multiple tabs open on new dot, all of them receive pusher updates. That's causing confusion because we're trying to apply them all, so depending on the tab you are, you'll see that they were applied, or that we've skipped them because they were already applied (in another tab).
This is also a problem when you receive an update that you are not up to date. If that happens, we will trigger N calls to GetMissingOnyxMessages.

  1. Alice's local lastUpdateID is 10, and she has 3 tabs open (A, B and C)
  2. Alice receives updateID 11, with previousUpdateID 10
    a. Tab A receives it first, so it applied the update
    b. Tab B and Tab C will log Update received was older than or the same as current state, returning without applying the updates other than successData and failureData
  3. Alice then receives update 15, with previousUpdateID 14
    a. All 3 tabs will receive that update
    b. All 3 tabs will call saveUpdateInformation after checking that the previousUpdateID do not match
    c. Because we execute the call for GetMissingOnyxUpdate on a callback of updates on the key ONYX_UPDATES_FROM_SERVER, and we updated that key 3 times on 3.b, each tab will call GetMissingOnyxUpdates 3 times (for a total of 9 calls to our servers)

We've solved issue 3.c on PR #39943, but we were still doing 3 requests (because we triggered the call back 3 times).

Solution

Only apply onyx updates from the main active client

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0101c143b6e4d4468d
  • Upwork Job ID: 1777976022050316288
  • Last Price Increase: 2024-04-10
@danieldoglas danieldoglas added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 10, 2024
@danieldoglas danieldoglas self-assigned this Apr 10, 2024
Copy link

melvin-bot bot commented Apr 10, 2024

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@allroundexperts
Copy link
Contributor

Taking over!

@danieldoglas danieldoglas added the Internal Requires API changes or must be handled by Expensify staff label Apr 10, 2024
Copy link

melvin-bot bot commented Apr 10, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0101c143b6e4d4468d

Copy link

melvin-bot bot commented Apr 10, 2024

Current assignee @allroundexperts is eligible for the Internal assigner, not assigning anyone new.

@CortneyOfstad
Copy link
Contributor

PR on staging as of last week — continuing to keep an eye on this!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 18, 2024
@melvin-bot melvin-bot bot changed the title GetMissinOnyxMessages being executed several times [HOLD for payment 2024-04-25] GetMissinOnyxMessages being executed several times Apr 18, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Apr 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.62-17 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-04-25. 🎊

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

Copy link

melvin-bot bot commented Apr 18, 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.
  • [@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Apr 24, 2024
@CortneyOfstad
Copy link
Contributor

Not overdue — payment is set for tomorrow.

@allroundexperts can you have the check list completed by EOD? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2024
@allroundexperts
Copy link
Contributor

I don't think a checklist is needed here.

Copy link

melvin-bot bot commented Apr 25, 2024

Payment Summary

Upwork Job

BugZero Checklist (@CortneyOfstad)

  • 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/1777976022050316288/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@CortneyOfstad
Copy link
Contributor

This is set to be paid via NewDot 👍

Payment Summary

@allroundexperts — to be paid $250 via NewDot 👍

@JmillsExpensify
Copy link

$250 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 Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

4 participants