Skip to content

[HOLD for payment 2024-01-24] [$500] AuthScreens reconnectApp call is passing an outdated lastUpdateIDAppliedToClient #32583

Description

@iwiznia

See conversation in https://expensify.slack.com/archives/C01GTK53T8Q/p1701890693827559

Steps:

  • Add a comment, I can see the lastUpdateID is returned and saved in the key OnyxUpdatesLastUpdateIDAppliedToClient
  • Go offline and back online
  • AuthScreens reconnect code (
    NetworkConnection.onReconnect(() => {
    if (isLoadingApp) {
    App.openApp();
    } else {
    App.reconnectApp(lastUpdateIDAppliedToClient);
    }
    });
    ) runs
  • But lastUpdateIDAppliedToClient is NOT the updated updateID we saved above

It is probably because this useEffect call

is passing [] as its dependency.
I was going to add lastUpdateIDAppliedToClient as a dependency but:

  • I noticed there's a lot of other variables that we are using that are not passed to useEffect
  • Not sure if there is a performance concern if I do that

I see that this behavior was introduced in this PR #27764 by @barttom, so ideally they would fix it.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018cbdee1256058e0a
  • Upwork Job ID: 1732503147695874048
  • Last Price Increase: 2023-12-06
  • Automatic offers:
    • jjcoffee | Reviewer | 27989002
    • situchan | Contributor | 27989059

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions