Skip to content

test: cover iOS persisted maxConcurrentTasks restore - #93

Merged
vietnguyentuan2019 merged 1 commit into
mainfrom
test/ios-limiter-persisted-limit
Nov 8, 2026
Merged

vietnguyentuan2019 merged 1 commit into
mainfrom
test/ios-limiter-persisted-limit

Conversation

@vietnguyentuan2019

Copy link
Copy Markdown
Contributor

Cold start on iOS (BGTask launching the app without Dart initialize) cant be driven on a simulator or from flutter run, so the part I can check is: what limit does a fresh process build from what was persisted.

Pulled the UserDefaults read out of the static initializer into persistedLimit(defaults:) (same behaviour, plus ignores non-positive/non-int values) and added tests: restore from a persisted value and enforce it with a brand new limiter, default when nothing is stored, invalid stored values fall back to 4. Ran in a temp macOS package (5 limiter tests pass), example app still builds for the simulator.

End-to-end BGTask cold start on a device is still not verified.

Extract persistedLimit(defaults:) from the static initializer so the value a cold-started process
will use is unit-testable; add tests for restore + enforcement and invalid persisted values.
@vietnguyentuan2019
vietnguyentuan2019 merged commit e6e638f into main Nov 8, 2026
13 checks passed
@vietnguyentuan2019
vietnguyentuan2019 deleted the test/ios-limiter-persisted-limit branch November 8, 2026 02:02
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