-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Fix duplication in the search results #8409
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website @nodejs/web-infra Please review the changes when you have a chance. Thank you! 🙏 |
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.
Pull request overview
This pull request fixes search result duplication by upgrading @orama/core from version 1.2.13 to 1.2.14 and implementing Orama's temporary datasource feature with atomic swapping. The changes ensure that search index updates occur without downtime and prevent duplicate entries during synchronization.
Key changes:
- Upgraded
@orama/coredependency to version 1.2.14 - Implemented temporary index creation and atomic swap pattern for zero-downtime updates
- Updated documentation URL reference to point to the current Orama documentation
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
apps/site/package.json |
Upgraded @orama/core dependency from ^1.2.13 to ^1.2.14 |
apps/site/scripts/orama-search/sync-orama-cloud.mjs |
Refactored sync logic to use temporary index with atomic swap; updated documentation URL and added explanatory comments |
pnpm-lock.yaml |
Updated lockfile to reflect new dependency versions and transitive dependency changes |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const datasource = orama.dataSource(process.env.NEW_ORAMA_DATASOURCE_ID || ''); | ||
|
|
||
| // Create a temporary index to perform the insertions | ||
| const temporary = await datasource.createTemporaryIndex(); |
Copilot
AI
Dec 11, 2025
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.
The temporary index is created at the top level before documents are fetched. If createTemporaryIndex() fails or if the script crashes after creating the temporary index but before swapping, the temporary index may remain orphaned. Consider creating the temporary index inside runUpdate() after successfully fetching documents, or add cleanup logic to handle failures.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8409 +/- ##
==========================================
- Coverage 73.73% 73.68% -0.05%
==========================================
Files 107 107
Lines 9155 9161 +6
Branches 308 311 +3
==========================================
Hits 6750 6750
- Misses 2403 2409 +6
Partials 2 2 ☔ View full report in Codecov by Sentry. |
mikeesto
left a comment
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.
Thanks! CI is failing?
> @node-core/website@ lint:types /home/runner/work/nodejs.org/nodejs.org/apps/site
> tsc --noEmit
Error: components/Common/Searchbox/index.tsx(34,7): error TS2322: Type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.14/node_modules/@orama/core/esm/cloud").OramaCloud | null' is not assignable to type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.13/node_modules/@orama/core/esm/cloud").OramaCloud | null'.
Type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.14/node_modules/@orama/core/esm/cloud").OramaCloud' is not assignable to type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.13/node_modules/@orama/core/esm/cloud").OramaCloud'.
Types have separate declarations of a private property 'client'.
ELIFECYCLE Command failed with exit code 2.
Error: command finished with error: command (/home/runner/work/nodejs.org/nodejs.org/apps/site) /home/runner/setup-pnpm/node_modules/.bin/pnpm run lint:types exited (2)
Description
Orama provides the temporary datasource feature, which allows the client to insert documents there and swap the datasource atomically, without downtime. I've also added comments to explain the change.
Validation
Related Issues
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.