Skip to content

fix(cloudstore): invalidate dashboard read model cache on mutation insert#253

Open
idrojone wants to merge 2 commits intoGentleman-Programming:mainfrom
idrojone:fix/cloud-cache-invalidation
Open

fix(cloudstore): invalidate dashboard read model cache on mutation insert#253
idrojone wants to merge 2 commits intoGentleman-Programming:mainfrom
idrojone:fix/cloud-cache-invalidation

Conversation

@idrojone
Copy link
Copy Markdown

@idrojone idrojone commented Apr 26, 2026

🔗 Linked Issue

Closes #251


🏷️ PR Type

  • type:bug — Bug fix
  • type:feature — New feature
  • type:docs — Documentation only
  • type:refactor — Code refactoring (no behavior change)
  • type:chore — Maintenance, dependencies, tooling
  • type:breaking-change — Breaking change

📝 Summary

  • Invalidate dashboard read model cache after successful mutation batch insert.
  • Add focused regression test for InsertMutationBatch cache invalidation.

📂 Changes

File Change
internal/cloud/cloudstore/cloudstore.go Invalidate dashboard read model cache after mutation insert commit.
internal/cloud/cloudstore/project_controls_test.go Add regression test for cache invalidation on InsertMutationBatch.

🧪 Test Plan

  • Unit tests pass locally: go test ./...
  • E2E tests pass locally: go test -tags e2e ./internal/server/...
  • Manually tested the affected functionality

🤖 Automated Checks

Check What it verifies Status
Check Issue Reference PR body contains Closes #N / Fixes #N / Resolves #N
Check Issue Has status:approved Linked issue has status:approved label
Check PR Has type: Label* PR has exactly one type:* label
Unit Tests go test ./... passes
E2E Tests go test -tags e2e ./internal/server/... passes

✅ Contributor Checklist

  • I linked an approved issue above (Closes #N)
  • I added exactly one type:* label to this PR
  • I ran unit tests locally: go test ./...
  • I ran e2e tests locally: go test -tags e2e ./internal/server/...
  • Docs updated (if behavior changed)
  • Commits follow conventional commits format
  • No Co-Authored-By trailers in commits

💬 Notes for Reviewers

Scoped to #251 only: cache invalidation fix + regression test. No Docker Compose or .gitignore changes.

This ensures the dashboard reflects new memories arriving via autosync push
without requiring a server restart.
Copilot AI review requested due to automatic review settings April 26, 2026 19:38
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.

Copy link
Copy Markdown
Collaborator

@Alan-TheGentleman Alan-TheGentleman left a comment

Choose a reason for hiding this comment

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

Thanks for the focused fix. The actual cache invalidation change is correct, but I am not going to merge this PR while it also changes Docker Compose defaults and .gitignore.

Please keep this PR scoped to #251: leave the cs.invalidateDashboardReadModel() call, add a focused regression test for InsertMutationBatch, and remove the unrelated .gitignore and docker-compose.cloud.yml changes. The Compose changes are especially risky because they replace zero-config local defaults with required env vars and change localhost-only bindings to 0.0.0.0. Once the PR is scoped down, I can review it on the actual bug fix.

@idrojone
Copy link
Copy Markdown
Author

idrojone commented Apr 29, 2026

Thanks for the review. You’re right about the scope.
Clarifying: the changes in .gitignore and docker-compose.cloud.yml were mine just for testing, but they shouldn’t be in this PR. I pushed them without realizing it, thanks for catching that.
I’ve removed them and kept PR #253 strictly scoped to #251:

  • cs.invalidateDashboardReadModel() remains at the end of InsertMutationBatch.
  • I added a focused regression test in project_controls_test.go.
  • I removed the .gitignore and docker-compose.cloud.yml changes.

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.

fix(cloudstore): InsertMutationBatch does not invalidate dashboard read model cache

3 participants