-
-
Notifications
You must be signed in to change notification settings - Fork 930
perf: denormalize latestVersionSummary into skillSearchDigest #776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -958,11 +958,7 @@ async function buildPublicSkillEntries( | |
| const entries = await Promise.all( | ||
| skills.map(async (skill) => { | ||
| // Use denormalized summary when available to avoid reading the full ~6KB version doc. | ||
| // HydratableSkill (from digest rows) won't have latestVersionSummary. | ||
| const summary = | ||
| 'latestVersionSummary' in skill | ||
| ? (skill as Doc<'skills'>).latestVersionSummary | ||
| : undefined | ||
| const summary = skill.latestVersionSummary | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Switching Useful? React with 👍 / 👎. |
||
| const hasSummary = includeVersion && summary | ||
| const [latestVersionDoc, ownerInfo] = await Promise.all([ | ||
| includeVersion && !hasSummary && skill.latestVersionId | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fallback path no longer covered by tests
makeSkillnow unconditionally includeslatestVersionSummary, so every test in this file exercises the "use summary" fast path. The regression path — wherelatestVersionSummaryisundefinedandbuildPublicSkillEntriesmust fall back toctx.db.get(skill.latestVersionId)— is no longer tested. This matters because the PR description explicitly calls out that backfilling existing digest rows is a post-deploy step, meaning old rows without the field will hit this code path in production.Consider adding a test with
latestVersionSummary: undefined(or omitting it) that verifiesdb.getis called with the version ID and the result is surfaced correctly.Prompt To Fix With AI