8000 fix(ios): restore archived export from routed detail by shroominic · Pull Request #86 · shroominic/OpenGlucose · GitHub
[go: up one dir, main page]

Skip to content

fix(ios): restore archived export from routed detail - #86

Closed
shroominic wants to merge 2 commits into
mainfrom
fix/export-flow-robustness
Closed

shroominic wants to merge 2 commits into
mainfrom
fix/export-flow-robustness

Conversation

@shroominic
Copy link
Copy Markdown
Owner

Summary

  • Restore archived-sensor export from the real pushed detail route by placing the share and Health Export scopes above MaterialApp and its Navigator.
  • Serialize one export at a time and show explicit preparing, sharing, and cleanup states so repeated taps cannot invoke the native bridge concurrently.
  • Keep export failures actionable with privacy-safe, stage-coded OGEXP1 diagnostics and a copyable support code.
  • Remove the scoped temporary export directory after a payload-write failure, while preserving the original write error.
  • Add route-level regressions for a 5,000-reading archive, exact native invocation count, native failure/retry, state reset, and temporary-file cleanup.

Root cause

The v0.1.5 share scope wrapped only MaterialApp.home. The archived-sensor detail screen is pushed by the app Navigator, so its BuildContext was outside that inherited scope. After the format confirmation closed, _ArchivedSensorShareScope.of(context) returned no scope and release code threw before the previous export try/catch. The visible result matched the recording exactly: the confirmation dialog disappeared, but the Apple share sheet did not open and no useful error was shown.

This PR moves the scopes above MaterialApp, moves scope resolution inside the guarded export block, and adds a route-level test that would fail on v0.1.5.

Verification

  • make test-unit — passed; all package suites green and OpenHealth 266/266.
  • flutter analyze — passed with no issues.
  • Pre-commit format and workspace analysis hooks — passed.
  • flutter build ios --simulator --debug --no-pub — passed and produced Runner.app from commit 04689c4.
  • Focused export regression group — 24/24 passed.
  • Independent review of both commits — no P0–P2 findings.
  • iOS Simulator fixture: the production app loaded one seeded archived session with 30,644 readings from the restricted health-state store. Final share-sheet capture is still a release gate because the user stopped device/simulator UI automation before it completed.

Risk and release gate

This is an R2 health-data export path. The change does not alter the export schema, dependencies, native iOS presenter, release metadata, or stored user data. Do not merge or release until its integration with the other urgent export PRs (including #85) is resolved and a final iOS share-sheet smoke test passes.

Rollback is a normal revert of these two commits; there is no migration.

@shroominic
Copy link
Copy Markdown
Owner Author

Superseded by #88, which integrates these verified export fixes on top of merged #85, preserves English/Simplified Chinese localization, fixes locale priority, and prepares v0.1.6+28.

@shroominic shroominic closed this Aug 31, 2026
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

0