connectrpc / connect-query-es

TypeScript-first expansion pack for TanStack Query that gives you Protobuf superpowers.
https://connectrpc.com/docs/web/query/getting-started
Apache License 2.0
218 stars 14 forks source link

Timestamps in query key can trigger infinite query loops #361

Closed paul-sachs closed 4 months ago

paul-sachs commented 4 months ago

Using the following query will cause an infinite loading query:

import { Timestamp } from "@bufbuild/protobuf";
...
useSuspenseQuery(
  someMethod,
  {
    start: Timestamp.fromDate(new Date("01/01/01")),
    end: Timestamp.fromDate(new Date("02/01/01"))
  }
);

This is likely due to the handling of class objects in stable-hash.

paul-sachs commented 3 months ago

Fixed in 1.4.0