Skip to content

fix(profile): do not delete stored reports on profile save - #74

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-700d
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-700d

Conversation

@cursor

@cursor cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

What changed

  • Profile Save always called POST /api/profile/invalidate-cache, which deleted comprehensiveMysticalProfiles/{uid} — every stored natal chart and catalog reading.
  • That wipe did not reset mysticalProfileGenerated or allReportsReady. After a non-hash save (for example a birth-time note), Generate treated the profile as already complete and catalog resume never ran, so the readings stayed gone.
  • Invalidate-cache now only clears the in-memory divination cache. Stored reports persist until the user clicks Generate and the pipeline rewrites them for a new profile hash. Admin workspace clear is unchanged.

Why this change is safe

Verification

  • ESLint on touched files (pnpm exec eslint app/api/profile/invalidate-cache/route.ts tests/integration/invalidate-cache.test.ts)
  • pnpm test (74 suites / 396 tests)
  • pnpm run lint:security
  • Playwright smoke (auth-gated Profile Save; not run in this environment)
  • Note: pnpm run security still fails on pre-existing high/critical advisories on main (next, sharp, js-yaml); not introduced here.

Regression prevention

  • Added tests/integration/invalidate-cache.test.ts: authenticated call clears in-memory cache and must not call deleteDocument.
  • 401 paths still reject missing/invalid tokens without touching storage.

Release checklist (solo-friendly)

  • CI is green:
    • CI / Lint + Jest
    • CI / Playwright smoke
  • Ready to merge to main after review.
  • Post-merge: generate a full report, save a birth-time note (or re-save unchanged details), open Tarot/Vedic — stored readings must still be there.
Open in Web View Automation 

Profile Save always called /api/profile/invalidate-cache, which deleted
comprehensiveMysticalProfiles/{uid}. Cosmetic or note-only saves then wiped
every catalog reading while mysticalProfileGenerated and allReportsReady
stayed true, so Generate skipped and resume never refilled.

Co-authored-by: Andy Oliver Rozario <andyrozario7@gmail.com>
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
future-seer Ready Ready Preview Sep 10, 2026 11:13am UTC

@AndyOliverR

Copy link
Copy Markdown
Owner

Superseded by #78 — unique fix cherry-picked onto current main (profile save no longer deletes stored reports).

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