Skip to content

Update Resthooks cache on new events rather than refetching

Loic Huder requested to merge fix-refetch into main

Due to the numerous improvements of the last weeks, I am eager to make a release to give a usable version to beamlines. The only thing preventing me from doing so is the refetch on new events (#178). However, solving #178 properly likely requires a rethink of the server-side API that I am not willing to undertake for this release.

So I worked on a temporary solution that uses a suggestion made in #178 (_ mutate the cache of rest-hooks without triggering refetches_) and the Manager API from Rest hooks to mutate it on websocket events (https://resthooks.io/docs/api/Manager#data-stream). Even though the result is not ideal and has things poking out, I think it still goes the right way and can be leveraged even after API changes.

Merge request reports