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

[$250] [HOLD for payment 2025-01-30] Background network processing #50140

Closed
gedu opened this issue Oct 3, 2024 · 26 comments
Closed

[$250] [HOLD for payment 2025-01-30] Background network processing #50140

gedu opened this issue Oct 3, 2024 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@gedu
Copy link
Contributor

gedu commented Oct 3, 2024

Problem

The primary issue we aim to address is ensuring the reliability of message delivery in our chat app. Users have reported instances where messages fail to send, only being dispatched when the app is reopened. This problem is particularly evident in the following scenarios:
● iOS: Messages are not sent when the app transitions to the background, during shifts from offline to online status, or under poor internet conditions.
● Android: Similar issues occur when the app is backgrounded with unstable internet connections. Additionally, there is uncertainty about the app’s behavior during transitions from offline to online across different Android devices.

Solution

To enhance the user experience, we propose implementing background task processing to manage network requests even when the app is not actively open. This approach aims to:

  1. Process Requests in the Background: Allow the app to detect when the device comes back online and send queued requests while in the background.
  2. Reduce Queue Size: Implement improvements such as avoiding duplicate requests and simplifying message handling to keep the network queue as empty as possible.

By addressing these issues, we aim to provide a seamless messaging experience, ensuring that messages are sent promptly and reliably, regardless of the app’s state or network conditions.

Additional Solutions for Web and Desktop

Web: Leverage Service Workers for handling background sync when internet connection is re-established.
Desktop: Use Electron’s background task handling capabilities (e.g., electron-ipc).

Before (current app - Android Slow connection)

no_background_processing.mp4

After

background_processing_android_working.mp4

Cases:

  1. User is offline or in a poor network connection

  2. User takes some actions and serializes network requests

  3. User puts app in the background

  4. User regains network connection, requests from the queue start executing.

  5. User opens the app and has no remaining network requests (or maybe a few)

  6. Open the app from a notification

  7. Read it

  8. Write a response

  9. Switch apps

This background processing will prevent a message from not being sent due to moving quickly to the background.

Slack Thread: https://expensify.slack.com/archives/C05LX9D6E07/p1727884875529299

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021884036697836731036
  • Upwork Job ID: 1884036697836731036
  • Last Price Increase: 2025-01-28
  • Automatic offers:
    • shubham1206agra | Reviewer | 105883577
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @mananjadhav
@szymonrybczak
Copy link
Contributor

Hey, I'm Szymon from Callstack and I can work on this 🫡

@szymonrybczak
Copy link
Contributor

Hey, I started working on this issue and in first place I looked on what are possible libraries that we leverage to solve this problem. I've started with Native platforms. There are not many tools that are solving this problem well, and actually there are two that I found that are maintained:

I'd go with expo-background-fetch together with expo-task-manager which overall fits as more reliable and better option for this use case.

@szymonrybczak
Copy link
Contributor

Hey, update from my side. I successfully implemented PoC of registering background task with expo-task-manager on iOS. Right now I'm focusing on doing the same on Android, there's one crash when app starts - I'm trying to investigate why is it happening.

@gedu
Copy link
Contributor Author

gedu commented Nov 8, 2024

Updated P/S

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

This issue has not been updated in over 15 days. @szymonrybczak eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@muttmuure muttmuure moved this from CRITICAL to HIGH in [#whatsnext] #quality Nov 19, 2024
@szymonrybczak
Copy link
Contributor

Hey, just to update this issue with current status - we'll be developing our own implementation of executing background task. Here's a separate issue with all necessary informations: #52700

Copy link

melvin-bot bot commented Jan 14, 2025

Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jan 17, 2025
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2025-01-30] Background network processing [$250] [HOLD for payment 2025-01-30] Background network processing Jan 28, 2025
@melvin-bot melvin-bot bot added Help Wanted Apply this label when an issue is open to proposals by contributors and removed Overdue labels Jan 28, 2025
Copy link

melvin-bot bot commented Jan 28, 2025

Current assignee @shubham1206agra is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 28, 2025
Copy link

melvin-bot bot commented Jan 28, 2025

📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added the Overdue label Jan 30, 2025
Copy link

melvin-bot bot commented Jan 31, 2025

@mananjadhav, @luacmartins, @shubham1206agra, @szymonrybczak Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mananjadhav
Copy link
Collaborator

@luacmartins @mountiny Can you assign a BZ for the payout here?

@melvin-bot melvin-bot bot removed the Overdue label Jan 31, 2025
@mountiny mountiny added the NewFeature Something to build that is a new item. label Jan 31, 2025
Copy link

melvin-bot bot commented Jan 31, 2025

Triggered auto assignment to @laurenreidexpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jan 31, 2025
@mananjadhav
Copy link
Collaborator

@laurenreidexpensify Quick bump on the payment summary.

@laurenreidexpensify
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

@laurenreidexpensify
Copy link
Contributor

@mananjadhav sorry for delay - this was a weekly so not on my immediate radar.
Please complete checklist before we can close thanks

@laurenreidexpensify laurenreidexpensify added Daily KSv2 and removed Weekly KSv2 labels Feb 5, 2025
@mananjadhav
Copy link
Collaborator

This was more of a non-customer issue. There's no specific regression test suite and can be tagged as feature request.

Copy link

melvin-bot bot commented Feb 10, 2025

@mananjadhav, @luacmartins, @shubham1206agra, @laurenreidexpensify, @szymonrybczak Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Feb 10, 2025
@laurenreidexpensify
Copy link
Contributor

Closing as no further action required

@garrettmknight
Copy link
Contributor

$250 approved for @mananjadhav

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 Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
Status: Done
Development

No branches or pull requests

8 participants