Reschedule media uploads when the Wi-Fi-only preference changes - #3946
Open
shobhitagarwal1612 wants to merge 1 commit into
Open
shobhitagarwal1612 wants to merge 1 commit into
shobhitagarwal1612 wants to merge 1 commit into
Conversation
WorkManager constraints are immutable once a request is enqueued, so unchecking "Upload photos over Wi-Fi only" never applied to media uploads which had already been scheduled. Appending a new request left it blocked behind work still awaiting an unmetered connection, so pending photos were only uploaded once the device rejoined Wi-Fi. Replace pending media upload work when the preference changes so that the newly selected network type takes effect, and cancel it when local data is cleared, so that work left behind by a signed out user can't block uploads enqueued by the next one. Fixes #3945
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.
Fixes #3945
WorkManager constraints are immutable once a request is enqueued, so unchecking "Upload photos over Wi-Fi only" never applied to media uploads which had already been scheduled. Appending a new request left it blocked behind work still awaiting an unmetered connection, so pending photos were only uploaded once the device rejoined Wi-Fi.
Replace pending media upload work when the preference changes so that the newly selected network type takes effect, and cancel it when local data is cleared, so that work left behind by a signed out user can't block uploads enqueued by the next one.
Also adds missing test coverage for the worker.
Screen_recording_20260916_222109.webm
@jo-spek @gino-m PTAL?