Add search/query support for file-meta entries#3912
Merged
Conversation
9dac7ed to
a781e85
Compare
Preview deployments |
a781e85 to
a547883
Compare
Host Test Results 1 files 1 suites 1h 42m 50s ⏱️ Results for commit eebfdd9. ♻️ This comment has been updated with latest results. |
e4b3f93 to
e2ee565
Compare
The client-side search pipeline (SearchResource) was built exclusively
for card resources, causing "not a card collection document" errors when
queries returned file-meta results. This broadens the pipeline to accept
and correctly process file-meta resources alongside cards.
- Broaden generic type constraints from `<T extends CardDef>` to
`<T extends CardDef | FileDef>` across SearchResource, StoreSearchResource,
GetSearchResourceFunc, and getSearchResource
- Replace isCardCollectionDocument with isLinkableCollectionDocument
to accept file-meta collection responses
- Route file-meta resources through store.get(id, { type: 'file-meta' })
instead of store.add({ data }) which only handles cards
- Use type-aware store.peek with { type: 'file-meta' } for retrieval
- Fix wireUpNewReference to check file-meta map before falling back to
getCardInstance, eliminating spurious 415 errors for non-card URLs
- Downgrade noisy query-field-support cache-hit log from info to debug
- Add client-side SearchResource tests for file-meta search and live
file-meta search
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fa79768 to
4c7ee31
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds search and query support for file-meta entries, enabling FileDef instances to be queried and returned alongside card instances in search operations.
Changes:
- Renamed
CardCollectionDocumenttoLinkableCollectionDocumentto support both card and file-meta resources - Added
searchCardsmethod to replace genericsearchmethod for clarity - Implemented file-meta type detection in query processing to route queries appropriately
- Updated search resources and store to handle file-meta instances
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime-common/search-utils.ts | Updated type references to support linkable collections |
| packages/runtime-common/realm.ts | Renamed search method and updated query handling |
| packages/runtime-common/realm-index-query-engine.ts | Added file-meta query detection and routing logic |
| packages/runtime-common/query-field-utils.ts | Enhanced filter normalization for file-meta queries |
| packages/runtime-common/index.ts | Exported new file-meta collection types |
| packages/runtime-common/index-query-engine.ts | Added searchFiles method and file-meta type checking |
| packages/runtime-common/document-types.ts | Defined LinkableCollectionDocument and validation functions |
| packages/realm-server/tests/realm-endpoints/search-test.ts | Added tests for file-meta search functionality |
| packages/realm-server/tests/realm-endpoints-test.ts | Updated test expectations with sample.md file |
| packages/realm-server/tests/indexing-test.ts | Updated search method calls to searchCards |
| packages/realm-server/tests/cards/sample.md | Added markdown test file |
| packages/host/tests/unit/index-query-engine-test.ts | Updated all search calls to searchCards |
| packages/host/tests/integration/resources/search-test.ts | Added file-meta search integration tests |
| packages/host/tests/integration/realm-test.gts | Updated search method calls |
| packages/host/tests/integration/realm-querying-test.gts | Added file-meta query tests and updated method calls |
| packages/host/tests/integration/realm-indexing-test.gts | Updated search method call |
| packages/host/tests/helpers/realm-server-mock/routes.ts | Updated type references for linkable collections |
| packages/host/tests/cards/file-query-card.gts | Added test card for file-meta queries |
| packages/host/tests/acceptance/code-submode/field-playground-test.gts | Updated search method calls |
| packages/host/tests/acceptance/code-submode/card-playground-test.gts | Updated search method calls |
| packages/host/app/services/store.ts | Added file-meta instance handling in store |
| packages/host/app/resources/search.ts | Enhanced search resource to support file-meta results |
| packages/host/app/lib/gc-card-store.ts | Updated type signatures for file-meta support |
| packages/experiments-realm/file-search-playground.gts | Added demonstration card for file-meta search |
| packages/experiments-realm/FileSearchPlayground/playground.json | Added example instance of file search playground |
| packages/base/query-field-support.ts | Changed log level from info to debug |
| packages/base/card-api.gts | Updated type signatures to support FileDef in search |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backspace
approved these changes
Feb 2, 2026
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.
No description provided.