n1ru4l/graphql-live-query

Unsubscribe/dispose doesn’t work with applyLiveQueryJSONDiffPatchGenerator

ianberdin opened this issue · 3 comments

Only today I noticed that when using applyLiveQueryJSONDiffPatchGenerator, unsubscribing (dispose) to queries does not work. I.e. if you Invalidate(...), it will still send a patch to the client. However, everything works if you remove applyLiveQueryJSONDiffPatchGenerator.

  1. Code from example
const execute = flow(
    liveQueryStore.makeExecute(defaultExecute),
    applyLiveQueryJSONPatchGenerator
);
  1. Code from readme
const result = applyLiveQueryJSONDiffPatchGenerator(
  execute(...)
);

An example: the last message is a patch After unsubscribe.
image

Node: v16.13.1
Chrome: v96
graphql-ws: 5.5.5
@urql/core: 2.3.6
@n1ru4l/graphql-live-query: 0.9.0
@n1ru4l/graphql-live-query-patch-jsondiffpatch: 0.7.0
@n1ru4l/in-memory-live-query-store: 0.8.0

I will get to this soon, the AsyncIterable cleanup is not properly proxied

@ianberdin COuld you please confirm whether this is resolved with the following versions: #850 (comment)

@n1ru4l It perfectly works, thanks a lot!