Deniz Aygun
05/10/2023, 6:23 PMsearch
queue worker to process any search changes to Typesense however sometimes this can take a few seconds to process and is done asynchronously so that means the search-data being returned to the frontend can possibly be out-of-date, and the frontend would need to be reloaded after a few seconds or poll the backend.
The main reason this issue arises is because essentially the frontend allows “items” in our business to be “withdrawn”, and withdrawing an item is a slightly intense process so we have that queued, but if we were to do it synchronously sure it would return an updated dataset directly from the DB in real-time so no need to refresh or poll, but this would still mean that the typesense search queue could be processing still, so if you were to refresh the page immediately you would still see outdated search-data.
Any insights would be much appreciated.Jason Bosco
05/11/2023, 3:22 AM