Awesome Reviewers

Handle errors at the right boundary, keep failure state consistent, and ensure tests validate the real semantics.

Apply these rules: 1) Don’t swallow errors inside reusable helpers.

Example (pattern):

export async function refetchAllQueries({ queryCache }) {
  return Promise.all(
    queryCache.getAll().map(query =>
      query.fetch({ force: true })
    )
  );
}

// In the caller/boundary where automatic fetching should not crash:
refetchAllQueries({ queryCache }).catch(err => {
  console.error(err?.message ?? err);
  // keep error observable to the boundary’s own logic
});

2) Make failure metrics deterministic.

3) Ensure tests genuinely exercise error-handling behavior.

Result: callers can detect failures, internal failure state doesn’t drift, and tests accurately guard the intended error-handling semantics.