I have an instantsearch UI, an algolia index, and a database-backed API which is the single source of truth for the searchable records. The UI can update a record, which sends a PATCH request to the server. When the server successfully updates a record, it will then send the updated record to algolia for indexing.
The problem I’m having is reflecting the updated record in the search UI as soon as algolia updates the record. I’ve tried refreshing the cache as soon as the user receives a response from the API that the PATCH request succeeded, but it seems to just get stale data again because algolia hasn’t yet received the updated record from the API.
I’ve looked into waitTask, but the instantsearch UI isn’t updating algolia directly so there’s no client-originating operation for it to wait for. Does algolia have any recommendations or guidance for how to handle this type of situation?