diff --git a/desktop/src/features/messages/hooks.ts b/desktop/src/features/messages/hooks.ts index 478878b939..4f1288c9b5 100644 --- a/desktop/src/features/messages/hooks.ts +++ b/desktop/src/features/messages/hooks.ts @@ -591,6 +591,10 @@ export function useToggleReactionMutation() { }, onError: (_error, _variables, context) => { if (context) { + // Rollback restores the pre-click snapshot. Narrow accepted edge: if a + // backfill landed a real event between onMutate and onError, this drops + // it too — but that needs a relay error racing an in-flight backfill, + // and the next backfill self-heals it. Not worth guarding. queryClient.setQueryData( context.queryKey, context.previous,