fix: draft pages appear in search results
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start in src/server/build-search-index.ts at scanContent(), then inspect src/server/api/search.ts and its buildDocs() path to confirm the runtime behavior. The work is done when pages with draft frontmatter are excluded from the static search index and runtime search remains consistent.
Written by the indexing model from the issue text.
Description
Problem
`src/server/build-search-index.ts` indexes all .md/.mdx files without checking the `draft` frontmatter field. Pages marked as drafts are findable via search, leaking unpublished content.
The runtime search handler (`src/server/api/search.ts`) uses `getPagesForVersion()` which may already filter drafts, but the static index builder (`build-search-index.ts`) does its own file scanning without this check.
Suggested Fix
- Check `fm.draft === true` in `scanContent()` and skip those pages
- Verify the runtime `buildDocs()` in `search.ts` also excludes drafts (it uses `getPagesForVersion` → `getPages` which filters via `isDraft`)
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 13h 36m
- Merged PRs (30d)
- 11
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raystack/chronicle
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in raystack/chronicle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
melgarafael/DeskcommCRM#1812 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
prisma/prisma-cli#309 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gregwebs/pi-quota-dispatcher#26 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openwatersio/slackwater.xyz#124 ·
Maintainers usually reply within 1 day
-
agent-reported area/browser area/docs documentation good first issue hacktoberfest help wanted P2
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days