Closed gitrojones closed 5 months ago
Issue reproduced.
The issue specifically relates to the context[this.$$cache]
used by PgExecutor not being reset between subscription payloads. This is specifically a bug in PgExecutor, a false assumption about the appropriateness of caching. This cache should also be cleared just before a new mutation field executes.
Moving discussion to https://github.com/graphile/crystal/issues/2079
Hello,
Here's a fork with reproduction of the subscription issue I was running into involving Lambda + List.
Setup:
DATABASE_URL
with your ownbasic-schema.sql
file or equivalent.yarn serve
(Assumes Node20)Steps:
Expectations: On insert/update we fetch the latest state of the record.
Reality: We fetch the latest state of the record once, then serve from cache moving forward.
Why is this a bug? If you remove the list from the lambda in
subscribePlan
all works as expected. It's only when a list is supplied that the record seems to be cached.Example of bug:
I did some poking around in the Grafast source but couldn't find anything obvious. Best guess is something to do with the dependency tracking with ListStep and determining safe cache vs unsafe cache.
Thanks!