Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 21, 2026

Summary

Fixes the data loss issue reported in #3269 where notes disappear after app updates.

Root cause identified:
The LocalPersisterLoaded flag prevented persister.load() from being called on subsequent app launches, even after updates. This meant data stored in SQLite wasn't being loaded into memory.

Changes:

  • Always call persister.load() on app start regardless of the flag
  • The LocalPersisterLoaded flag now only controls whether migrations run (to prevent running migrations multiple times across windows)

Updates since last revision

Simplified the fix per user request - removed startAutoSave() and just moved the load() call outside the conditional block.

Review & Testing Checklist for Human

  • Test with multiple windows: Since we now load data on every app start, verify this doesn't cause race conditions or duplicate data when multiple windows are open
  • End-to-end test: Create notes, close app, reopen, verify notes persist. Then update app version, reopen, verify notes still exist

Recommended test plan:

  1. Build and run the app locally
  2. Create several notes with content
  3. Close the app completely
  4. Reopen and verify notes are still there
  5. If possible, test with a user who experienced the data loss (like the reporter of my notes are gone after installed the updates. happened throughout the last 3 updates. #3269)

Notes

  • This fix was based on code analysis - the bug was not reproduced locally
  • Related issue Retrieve lost files after update #3259 confirms data IS still present in session files, just not being loaded
  • No new tests were added for this change

Link to Devin run: https://app.devin.ai/sessions/cf8771b763104074ac9af90acd60029c
Requested by: @ComputelessComputer


Open with Devin

This fixes the data loss issue reported in #3269 where notes disappear after updates.

Root cause:
1. The local persister was missing startAutoSave(), so changes were never
   persisted back to SQLite after the initial load.
2. The LocalPersisterLoaded flag prevented persister.load() from being called
   on subsequent app launches, even after updates.

Changes:
- Always call persister.load() on app start to ensure data is loaded
- Add startAutoSave() to persist changes back to SQLite
- The LocalPersisterLoaded flag now only controls whether migrations run
  (to prevent running migrations multiple times across windows)

Fixes #3269

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit fb3864c
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/69704855eb8d830008f8df40

@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit fb3864c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69704855fc441c0008ca96f6

@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit fb3864c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6970485501b8e50008b34c6d

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title fix(persister): add startAutoSave and always load data on app start fix(persister): always load data on app start regardless of flag Jan 21, 2026
@ComputelessComputer ComputelessComputer requested review from yujonglee and removed request for ComputelessComputer January 21, 2026 04:28
Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional flags.

Open in Devin Review

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.

2 participants