Skip to content
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

Warm offline views when starting the app #9728

Closed
jkuester opened this issue Jan 6, 2025 · 2 comments
Closed

Warm offline views when starting the app #9728

jkuester opened this issue Jan 6, 2025 · 2 comments
Labels
Type: Improvement Make something better

Comments

@jkuester
Copy link
Contributor

jkuester commented Jan 6, 2025

What feature do you want to improve?
The view indexes for an offline Pouch database are built on demand. So, for example, a freetext search view is only built the first time a user tries to search. After the initial build, the view is kept up to date as data in the database changes, but the initial indexing only happens when the first request is made.

The trouble is that for big views (like the freetext ones) the initial indexing time has been measured in minutes for a user with a non-trivial amount of data. This is time the user spends waiting (probably giving up) on the app to do what they want.

Describe the improvement you'd like
Instead of waiting for the user to trigger a query, we could proactively warm the views when the app starts (as suggested here: #9661 (comment)). This makes it much more likely that view queries will be responsive even the first time the user tries to use them.

Describe alternatives you've considered
The main question to consider would be if we should warm all the views or just some. If just some, how do we decide which views to warm? Warming all the views could waste disk space and processing power since we will be maintaining views that are not actually used by that user's workflows. (e.g. the reports_by_freetext view might not ever get used if the user cannot even access the Reports tab to see the search bar.)

Additional context
This issue is particularly relevant for #9544 and #9208 since both of those are going to trigger full-reindexing of the Pouch views.

@dianabarsan
Copy link
Member

We used to index all views on startup in v2 and have removed it since, because it took a very long time, cannot be cancelled and users end up being blocked from using their device.

It was an extremely poor user experience.

@jkuester
Copy link
Contributor Author

jkuester commented Jan 7, 2025

Got it. Thanks for the context @dianabarsan. In that case, I am going to close out this issue (no sense in fixing one poor UX by causing another).

@jkuester jkuester closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Make something better
Projects
None yet
Development

No branches or pull requests

2 participants