Skip to content

[Due for payment 2026-08-31] fix: read one effective update watermark everywhere so the missing-updates fetch can advance #98984

Closed

Description

@mountiny

Problem

The client tracks the last update ID it has saved to disk. When a Pusher event arrives from further ahead than that, the client knows it missed a stretch of updates and fetches them. It then throws that answer away: the fetch asks from the number on disk, but the check that accepts the answer reads a higher number, one that also counts WRITE updates staged in memory for the deferred flush. Against that higher number the answer looks like something the client already has, so apply() drops it.

Nothing moves after that. The number on disk stays put, so the next Pusher event finds the same gap, fires the same fetch from the same place, and drops the same answer. The write queue is paused while a gap is open, so the user's messages and expenses sit on the device. The staged marker that caused the drop only clears on flush, the flush needs the queue unpaused, and the queue unpauses only after the gap closes — nothing inside that circle can break it.

In production on 2026-08-18, across up to 46,000 accounts, clients discarded 28,620 GetMissingOnyxMessages ranges and 63,679 ReconnectApp ranges, 92,299 per day in total. Each one is a response the client asked for, received, then dropped without saving.

Solution

A catch-up response is now judged against the number on disk, the same number the fetch was sent from. A catch-up means GetMissingOnyxMessages, or a ReconnectApp carrying updateIDFrom. Every other response keeps the check it had, and a catch-up that genuinely trails what is on disk is still dropped.

The update manager, the deferred-update utils and the stall guard all read both numbers through a single getEffectiveLastUpdateID(), so the fetch and the check can no longer disagree. Two regression tests cover it — they fail on main and pass here — and the old should not escalate or back off when the fetch response reports progress test is replaced, because it asserted that a response ahead of the client counts as progress, which is always true when a gap exists and is exactly the contract this PR fixes.

PR

#98777

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    Reviewing
    Weekly
    and removed
    Daily
    on Aug 20, 2026
  2. melvin-bot commented on Aug 20, 2026

    @melvin-bot

    @mountiny — to hire @dmkt9 on Upwork, add the External label so a job is created and the offer is sent automatically.

  3. added
    Daily
    and removed
    Reviewing
    Weekly
    on Aug 24, 2026
  4. changed the title [-]fix: read one effective update watermark everywhere so the missing-updates fetch can advance[/-] [+][Due for payment 2026-08-31] fix: read one effective update watermark everywhere so the missing-updates fetch can advance[/+] on Aug 24, 2026
  5. 8 remaining items

  6. melvin-bot commented on Aug 28, 2026

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  7. melvin-bot commented on Aug 30, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  8. added
    Daily
    and removed
    Daily
    on Aug 31, 2026
  9. mallenexpensify commented on Sep 1, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dmkt9 paid $250 via Upwork

  10. dmkt9 commented on Sep 2, 2026

    @dmkt9
    Contributor

    Payment Summary

    Contributor+: @dmkt9 due $250 via NewDot

    @mallenexpensify I'm still receiving payments through Upwork.

  11. mallenexpensify commented on Sep 3, 2026

    @mallenexpensify
    Contributor

    @dmkt9 can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022095308120148753449

  12. dmkt9 commented on Sep 3, 2026

    @dmkt9
    Contributor

    @mallenexpensify Thanks. I've accepted the offer

  13. mallenexpensify commented on Sep 3, 2026

    @mallenexpensify
    Contributor

    @dmkt9 paid, summary updated above. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentDailyTask

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions