-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Add search in shared drives #2838
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: master
Are you sure you want to change the base?
Conversation
29b26d3
to
08ac9f6
Compare
86e7c3b
to
6b5e774
Compare
} | ||
|
||
export const queryAllDocs = async ( | ||
export const queryAllDocs = ( |
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.
if it returns a promise, then it's async, isn't it?
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.
No, async keyword is not needed if there is no await in the body of the function
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.
Yes I saw, so it's not a promise then, isn't it?
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.
It is a promise: querySharedDriveFiles and client.queryAll return a promise. It is just that we don't have to await them
|
||
export const isIOCozyFile = (doc: CozyDoc): doc is IOCozyFile => { | ||
return doc._type === FILES_DOCTYPE | ||
return doc._type === FILES_DOCTYPE || doc.driveId !== undefined // FIXME find a way to add the right doctype in the result |
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.
we already have isFile
in cozy-client models. Here we want something else, maybe we should change the func name isIOCozyFile
(there is a FIXME btw here)
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.
This is actually a cozy file but coming from shared drives, with a different doctype. I don't see any other name at the moment
6b5e774
to
86de9b1
Compare
- Updated SearchEngine to include shared drive doctypes in search and indexing processes. - Enhanced normalization and query functions to handle shared drive files. - Added tests for shared drive file handling in search results.
86de9b1
to
cb6314d
Compare
- Added support for realtime updates of shared drive documents in SearchEngine. - Introduced methods to add and remove shared drive realtime subscriptions. - Enhanced the init method to automatically setup realtime for shared drives. - Updated tests to cover new realtime functionality for shared drives.
6e6246d
to
a1df608
Compare
When it was possible
Each shared drive has it's own virtual doctype in the
io.cozy.files.shareddrives-${driveId}
form and each shared drive doctype has it's own search index.To have shared drive search index in realtime. SearchIndex user must follow the list of shared drive in the shared drives folder and call :
SearchIndex.addSharedDrive(driveId)
when a shared drive is added in realtimeSearchIndex.removeSharedDrive(driveId)
when a shared drive is removed in realtimeOr else, the data proxy will need a reload of the page to index new drives and stop index removed drives.
This PR needs cozy/cozy-client#1632 to be merged