-
Notifications
You must be signed in to change notification settings - Fork 369
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
Insert Silently #3197
Comments
Is it really the queries which are slow here (they should run on a background isolate with
This feels like solving a problem that shouldn't exist :D In my mind, this should be solved by the subscriber ignoring duplicate rows where possible. If it turns out that this is still hugely inefficient in your case, I can take a look at ways to inhibit some stream updates though. |
Thanks for the reply. Our main issue is that the page refreshes at all, the query is really fast. As an example our page is setup like this.
Which is calling
Within this stream builder we have other futures/streams active and if anything is added to the venues table while the user is looking at the single venue page it causes a rebuild on the stream and the page to flicker. |
I see, can you see if adding a distinct to the stream helpers? E.g. |
@simolus3 Why don't we add distinct automatically? |
Is your feature request related to a problem? Please describe.
Our app downloads data from a private api where users can download their data and the data the system requires them to have, it has a main 'loading' screen to load this data in using the main connection to the sqlite database. It also has a 'sync' connection to the database that downloads extra items in the background while the user is using the app, there are some fairly complex queries with joins when they are looking at certain 'show' pages that bring in all the related data. This is using a stream so that when the user has completed certain things on these pages the page updates automatically without having to refresh the whole screen.
The main issue we're having is when looking at one of these 'show' pages (which is a watchSingle with joins). There are also futures and other streams on these pages to load in extra data.
This is causing the page to jump/flicker while data is being loaded in the background.
Our example of this is you have a jobs table with a venue id.
The user looks at job 1 which joins in venue 1.
Venue 1 is already in the database as it was downloaded alongside job 1, however when looking at job 1, venue 45 has been downloaded and has caused the page to refresh as the 'venues' table has updated.
Describe the solution you'd like
Is there a way to only listen to certain rows or insert silently when we know the data won't being used on a frontend?
The text was updated successfully, but these errors were encountered: