Skip to content

Harden data integrity coverage for backup, import/export, and core journal flows#84

Merged
danielchalmers merged 2 commits intomainfrom
sympathetic-galliform
Mar 17, 2026
Merged

Harden data integrity coverage for backup, import/export, and core journal flows#84
danielchalmers merged 2 commits intomainfrom
sympathetic-galliform

Conversation

@danielchalmers
Copy link
Owner

@danielchalmers danielchalmers commented Mar 17, 2026

This PR hardens test coverage around the app’s most sensitive user-data paths and tightens a number of existing tests so they better reflect the real contracts the app depends on.

What’s included:

  • stronger regression coverage for backup, import, and export workflows
  • validation of cancel, failure, and success paths so data is not partially replaced or incorrectly marked as saved
  • archive round-trip checks to ensure relationship integrity is preserved through serialization
  • additional coverage for preference persistence edge cases and malformed stored values
  • more hot-path coverage around journal point interactions, medication behavior, note editing callbacks, and day-generation rules
  • cleanup of flawed or weak tests that were previously asserting the wrong behavior or allowing false positives

Validation:

  • full test suite run completed successfully
  • result: 188 passed, 1 skipped

…urnal flows

This change strengthens regression protection around the app’s most data-sensitive behavior, with a focus on preventing silent data loss, bad restores, and incorrect “success” states.

It adds high-value tests for:
- backup/import/export workflows, including cancel and failure paths
- archive round-trip relationship integrity
- preference restore behavior and malformed persisted values
- hot-path data generation and state propagation in core journal interactions
- edge cases around medication defaults, welcome-note generation, and user-visible state updates

It also tightens several existing tests that were weak or asserting the wrong contract, so the suite now better reflects the behavior we actually want to preserve.

Behaviorally, this also fixes one real risk discovered during the audit: importing backed-up preferences no longer wipes unrelated user settings that were never part of the backup.

Validation:
- full test suite run completed successfully
- result: 188 passed, 1 skipped
@danielchalmers danielchalmers merged commit 3d64598 into main Mar 17, 2026
1 check passed
@danielchalmers danielchalmers deleted the sympathetic-galliform branch March 17, 2026 21:14
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