Skip to content

Control Execution Frequency of recheckConnection() #77806

Closed

Description

@mountiny

Coming from a proposal here in slack

Proposal

Control Execution Frequency of recheckConnection()

Background

The Expensify app performs connectivity checks using Ping requests to verify network availability and resume pending actions after transitions between online and offline states. These checks are initiated when the device’s connection state changes and when pending requests exceed their timeout thresholds.
Users frequently move between WiFi, mobile data, throttled bandwidth, and offline states, especially in areas with weak or fluctuating coverage. Sentry data indicates a significant increase in connectivity-related events over recent weeks, reflecting more frequent transitions that activate connection-monitoring logic. Several parts of the app depend on these signals to resume normal activity after disconnection, and these transitions occur regularly in real-world mobile environments.

Problem

When a user’s network connection rapidly fluctuates, if the app triggers connectivity checks in quick succession, then excessive Ping requests accumulate and slow the user’s ability to resume actions after reconnecting.

Solution

Update recheckConnection() to limit how often it runs and to ensure only one instance executes at a time. When the function is already running or was triggered too recently, subsequent calls are ignored.
By preventing rapid, overlapping connectivity checks during unstable network conditions, the app avoids accumulating Ping requests and can reliably resume user actions once the connection stabilizes.

Issue OwnerCurrent Issue Owner: @RachCHopkins
Issue OwnerCurrent Issue Owner: @CosminStreteaCS

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 16, 2025
  2. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 16, 2025
  3. melvin-bot commented on Dec 16, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (External)

  4. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 16, 2025
  5. melvin-bot commented on Dec 16, 2025

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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.

  6. melvin-bot commented on Dec 16, 2025

    @melvin-bot

    Triggered auto assignment to @NikkiWines (AutoAssignerNewDotQuality)

  7. 3 remaining items

  8. CosminStreteaCS commented on Dec 23, 2025

    @CosminStreteaCS
    Contributor

    I will be out of office during 24/12/2025 – 01/01/2026 and can take over any new updates or follow-ups after I’m back.

  9. moved this from CRITICAL to AWAITING DEPLOYMENT in [#whatsnext] #qualityon Dec 29, 2025
  10. Krishna2323 commented on Jan 6, 2026

    @Krishna2323
    Contributor

    @RachCHopkins the PR was deployed to production two weeks ago, so this one is ready for the payment summary.

    @NikkiWines I don’t think we need a checklist here—do we?

  11. NikkiWines commented on Jan 6, 2026

    @NikkiWines
    Contributor

    Yeah I think we're fine without the checklist here

  12. RachCHopkins commented on Jan 13, 2026

    @RachCHopkins
    Contributor

    This is the regular $250 I assume @NikkiWines?

  13. NikkiWines commented on Jan 14, 2026

    @NikkiWines
    Contributor

    yep, I believe so but cc: @mountiny as you created this issue

  14. mountiny commented on Jan 14, 2026

    @mountiny
    ContributorAuthor

    No need for checklist and $250

  15. RachCHopkins commented on Jan 15, 2026

    @RachCHopkins
    Contributor

    Switching to Daily - will tackle this tomorrow

  16. RachCHopkins commented on Jan 16, 2026

    @RachCHopkins
    Contributor

    Payment Summary:

    No Upwork job.

    🟢 to @Krishna2323 to request payment.

  17. moved this from AWAITING DEPLOYMENT to Done in [#whatsnext] #qualityon Jan 16, 2026
  18. Krishna2323 commented on Jan 17, 2026

    @Krishna2323
    Contributor

    Requested in ND.

  19. twisterdotcom commented on Jan 18, 2026

    @twisterdotcom
    Contributor

    @Krishna2323 has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-1443-aee9-8e36-590a73a19074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

AutoAssignerNewDotQualityUsed to assign quality issues to engineersBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions