Skip to content

fix: make insights saving safer#117

Merged
olalie merged 2 commits into
mainfrom
fix/insights-persistence
May 19, 2026
Merged

fix: make insights saving safer#117
olalie merged 2 commits into
mainfrom
fix/insights-persistence

Conversation

@olalie

@olalie olalie commented May 19, 2026

Copy link
Copy Markdown
Owner
## Summary
Make insights saving safer and prevent problems caused by multiple TapMap instances running at the same time.

Changes:
- Save `insights.json` atomically
- Fall back safely if insights data is corrupt or invalid
- Keep only recognised insights sections
- Add a simple PID lock file to prevent concurrent writers
- Handle stale lock files safely
- Add tests for insights loading, saving and lock handling
- Add `Flask` explicitly to `requirements.txt`
- Remove unused `tomli` dependency

## Testing
- Verified locally on Windows
- Verified stale lock replacement
- Verified second instance exits cleanly
- Verified insights save/load roundtrip
- `pytest` → 173 passed

@olalie olalie merged commit ea5bb06 into main May 19, 2026
6 checks passed
@olalie olalie deleted the fix/insights-persistence branch May 19, 2026 11:11
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