Improve force update to also suspend firebase requests - #3936
Open
andreia-ferreira wants to merge 8 commits into
Open
andreia-ferreira wants to merge 8 commits into
andreia-ferreira wants to merge 8 commits into
Conversation
… data in case requests start being blocked
andreia-ferreira
requested a deployment
to
e2e-approval
September 11, 2026 16:00 — with
GitHub Actions
Waiting
andreia-ferreira
requested a deployment
to
e2e-approval
September 11, 2026 16:07 — with
GitHub Actions
Waiting
andreia-ferreira
requested a deployment
to
e2e-approval
September 11, 2026 16:10 — with
GitHub Actions
Waiting
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3936 +/- ##
============================================
+ Coverage 69.99% 70.21% +0.22%
- Complexity 2034 2055 +21
============================================
Files 424 427 +3
Lines 11648 11667 +19
Branches 1522 1521 -1
============================================
+ Hits 8153 8192 +39
+ Misses 2722 2701 -21
- Partials 773 774 +1
🚀 New features to boost your workflow:
|
shobhitagarwal1612
requested changes
Sep 12, 2026
| } | ||
| } | ||
|
|
||
| class UpdateRequiredException : DataStoreException("App update required") |
Member
There was a problem hiding this comment.
Can we rename to AppUpdateRequiredException?
|
|
||
| @Provides | ||
| fun providesShouldForceUpdateUseCase(appConfigRepositoryInterface: AppConfigRepositoryInterface) = | ||
| org.groundplatform.domain.usecases.ShouldForceUpdateUseCase( |
Member
There was a problem hiding this comment.
nit: Can we import the use case instead of using fully qualified imports?
| } | ||
| } | ||
| } catch (_: UpdateRequiredException) { | ||
| // Popup prompting the user to update is displayed, so we don't need to do anything here. |
Member
There was a problem hiding this comment.
Instead of silently consuming the exception, can we instead create a new UiEvent which the ui layer can then listen to for showing the dialog?
Comment on lines
+164
to
165
| if (viewModel.isAppUpdateRequired()) { | ||
| showForceUpdateDialog() |
Member
There was a problem hiding this comment.
Please see the other comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a force update is enabled, the outdated apps still continue requests to firebase. This PR makes the requests also stop before the app is updated. All pending mutations stay queued locally and should upload after the update.
This could be useful in case a specific version ships with a bug that may flood firebase with requests or bad data (since work manager can keep making requests in the background regardless if the app is in use or not), so that all traffic can be shut off right away instead of waiting for all users to update.
In order to do this, the logic that fetched the remote config and verified if an update was needed was refactored to a repository and a usecase so it could be better reused.
@shobhitagarwal1612 PTAL?