Skip to content

chore(backend): harden sqlite concurrent writes and add stress tests#10

Draft
hammond01 wants to merge 1 commit into
devfrom
chore/backend-hardening-tests
Draft

chore(backend): harden sqlite concurrent writes and add stress tests#10
hammond01 wants to merge 1 commit into
devfrom
chore/backend-hardening-tests

Conversation

@hammond01
Copy link
Copy Markdown
Owner

Summary

  • replace fragile MAX(row_id)+1 flow with safer insert/upsert + rowid backfill in SQLite repositories
  • add lock-aware retry with short backoff for SQLite lock/busy contention during writes
  • make activity log writes idempotent via ON CONFLICT(id) DO UPDATE
  • expand SQLite repository integration tests with concurrent insert stress coverage for captures, items, and activity logs

Why

SQLite shared-cache writes can transiently fail under concurrent writes (SQLITE_LOCKED_SHAREDCACHE). This PR improves resilience and ensures row id assignment remains stable under load.

Validation

  • backend tests: ./gradlew test

Copilot AI review requested due to automatic review settings May 22, 2026 09:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a 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