8000 fix(app): stop PathAccessException from blocking startup by shroominic · Pull Request #224 · shroominic/OpenGlucose · GitHub
[go: up one dir, main page]

Skip to content

fix(app): stop PathAccessException from blocking startup - #224

Draft
shroominic wants to merge 3 commits into
mainfrom
s/fix-path-access-startup-376c
Draft

shroominic wants to merge 3 commits into
mainfrom
s/fix-path-access-startup-376c

Conversation

@shroominic
Copy link
Copy Markdown
Owner

Summary

Startup could die on the splash with Failed to start: PathAccessException after restricted storage tried to open under a shared OpenGlucose application-support directory that an older HealthDatabase prepare had created with iOS FileProtectionType.complete (FileManager applies that attribute to intermediate directories too). A cold start before/around first unlock then fails closed.

Changes

  • iOS PrivacyStorageChannel: use completeUntilFirstUserAuthentication, create ancestors without a protection attribute, and repair protection whenever backup exclusion runs.
  • FileHealthStateStore: create/repair/exclude the shared OpenGlucose product directory before restricted files; map PathAccessException to an identifier-free StateError.
  • Pin path_provider_foundation to 2.5.1 and path_provider_android to 2.2.23 (method-channel impls) until the FFI/JNI rewrites are re-verified on launch.
  • Splash shows the OS error message without filesystem paths.
  • Docs/changelog/tests updated.

Verification

flutter test test/bootstrap_failure_label_test.dart \
  test/privacy_release_defaults_test.dart \
  test/health_state_store_io_test.dart
# 41 passed

health_store_test still needs libsqlite3.so on this agent image (pre-existing env gap; not caused by this change).

Risk

R2 (health/device persistence + iOS file protection). Existing installs with a complete-protected OpenGlucose parent are repaired on the next successful launch path through excludeFromBackup.

Open in Web Open in Cursor 

cursoragent and others added 3 commits October 1, 2026 05:16
iOS HealthDatabase prepare had applied FileProtectionType.complete to
intermediate OpenGlucose directories, so restricted-state launch could fail
closed before first unlock. Use until-first-auth protection, repair the
shared product directory on startup, pin path_provider off the FFI/JNI
rewrites, and surface identifier-free OS error text on the splash.

Co-authored-by: shroominic <shroominic@users.noreply.github.com>
The public Object? field could not be promoted for bootstrapFailureLabel,
which broke analyze and every native/web build that compiles main.dart.

Co-authored-by: shroominic <shroominic@users.noreply.github.com>
Pinning path_provider_foundation back to the method-channel 2.5.1 build
reintroduces the Darwin CocoaPod; commit the CI-resolved lockfiles so
iOS and macOS builds stay reproducible.

Co-authored-by: shroominic <shroominic@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4BA7 Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0