fix(personality): invalidate stale pre-MBTI cached snapshots - #18
Merged
Conversation
…rsion readSnapshot served personality_snapshots rows persisted before the cognitiveFunctions + mbti addition (profileVersion 2) as-is, missing those fields entirely. The dashboard's MbtiCard and CognitiveFunctionRadarChart read them unconditionally, crashing with "undefined is not an object (evaluating 't.map')". Now a cached row whose profileVersion doesn't match the current version is treated as a cache miss and falls through to a fresh compute, same as no cache at all.
ClaudiaFang
marked this pull request as ready for review
July 21, 2026 13:31
ClaudiaFang
pushed a commit
that referenced
this pull request
Jul 23, 2026
chore: add Vercel deployment config for docs site
ClaudiaFang
added a commit
that referenced
this pull request
Jul 23, 2026
…ache-fix fix(personality): invalidate stale pre-MBTI cached snapshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/personalityserved cachedpersonality_snapshotsrows persisted before the cognitiveFunctions + mbti addition (profileVersion 2) as-is — those rows lackmbti/cognitiveFunctionsentirely.MbtiCardandCognitiveFunctionRadarChartread those fields unconditionally, crashing withundefined is not an object (evaluating 't.map')on the Personality page.readSnapshotnow treats a cached row whoseprofileVersiondoesn't match the current version (2) as a cache miss, falling through to a fresh compute — same path as no cache at all.Test plan
server/src/routes/personality.test.ts: cache hit on matching version, cache-miss fallback for a row with noprofileVersionfield, cache-miss fallback forprofileVersion: 1pnpm test(root, all workspaces): cli 914 passed, server 658 passed, dashboard 15 passedpnpm build(cli + server) — clean tsc