-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat(#9544): add offline freetext search indexes #9661
base: master
Are you sure you want to change the base?
Conversation
initialReplicationLib.isReplicationNeeded(localDb, userCtx), | ||
swRegistration, | ||
setReplicationId(POUCHDB_OPTIONS, localDb), | ||
offlineDdocs.init(localDb) |
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 the only real change here. The rest is just a quick re-factor to use async/await.
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.
These changes in shared-libs/search
are just temporary. The proper changes will need to be made against the cht-datasource code once we re-base on top of that.
This is why I have not added any additional unit tests to cover this logic (or worried too much about code structure).
|
||
describe('contacts_by_freetext', () => { | ||
[ | ||
['online view', loadView('medic-db', 'medic-client', 'contacts_by_freetext')], |
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 will need to remove this once the medic-client/contacts_by_freetext
view is deleted, but for now I thought it was useful to keep this in here to prove that the new offline indexes behave exactly the same as the original ones.
c.c. @m5r and @tatilepizs Particularly regarding how I have updated the e2e search tests to run both for an online and an offline user. I think this means these same tests can cover the offline indexes and the new Lucene functionality. 👍 |
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 bootstrapper code gets run during the main initialization of the app (before any of the Angular code spins up. This bootstrapping gets run during initial login and also when reloading the app (e.g. when the webapp-code/app-settings/ddocs change).
So, any time in the future when we make updates/additions/removals of views here, we can be confident that everything will be initialized properly in the local db when the app reloads.
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.
Nothing to add to Sugat's comments. I left an open-ended question about warming up views in the bootstrapper but it's not a blocker
webapp/src/js/bootstrapper/offline-ddocs/medic-offline-freetext/index.js
Show resolved
Hide resolved
Co-authored-by: Sugat Bajracharya <[email protected]>
For clarity, this PR is now is now blocked waiting on #9541. They should both be merged together before going to |
Description
Closes #9544
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.