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

feat: SQDSDKS-5924 - Batching events with delay after app goes backgrounded #461

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

markvdouw
Copy link

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

Whenever the upload action is receive by our handlers and the batches are upload, we trigger a next upload message if the uploadInterval set by the user is greater than 0 and either
-The app isNotBackgrounded and the session is active OR
-The app isBackgrounded and either any of the batch upload failed and we would like to retry it in the future or there are messages ready to be sent in the future

When going to background an alarm is set based on the uploadInterval to upload batches even if the app is closed.
If the app is switched between background and foreground before scheduling a new alarm the previous one will be canceled.

Testing Plan

  • Was this tested locally? If not, explain why.

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Screen Shot 2023-12-11 at 07 37 11

Sam Dozor and others added 6 commits November 3, 2023 14:05
… batch upload

Implementing as the legacy impl, a delayed message with type UPLOAD based on dynamic delay
Adding feature flag ebb to "enableBackgroundBatching", read from config and default=false
Adding Service for uploading
Adding class in proguard
Business logic changes on AppStateManager to route to different implementations based on feature flag.
Business logic change at the upload handler level to dismiss automatic upload interval and upload at session end when batching is enabled.
Deprecating function in Media API
Minor business logic changes in AppStatemanager
Removing featrue flag on ConfigManager for platform consistency
sdk is backgrounded and there are no messages stored pending and the upload table is empty.
@markvdouw markvdouw changed the base branch from main to development December 13, 2023 12:07
markvdouw added 3 commits December 14, 2023 10:58
Setting min alarm delay to 2mins
Adding logic to handle both background event batching and current behavior
Changing package receiver package name
Removing comments
@samdozor samdozor force-pushed the development branch 4 times, most recently from 4759c74 to a831780 Compare March 2, 2024 02:49
@rmi22186 rmi22186 force-pushed the development branch 4 times, most recently from fca8a44 to b67c108 Compare May 29, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant