Skip to content

Commit

Permalink
Implement a fix for the "ERROR Error: Observable cancelled prematurel…
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrc committed Aug 2, 2021
1 parent 550ec23 commit f4ec21c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/observables/Concast.ts
Expand Up @@ -178,7 +178,7 @@ export class Concast<T> extends Observable<T> {
// Delay unsubscribing from the underlying subscription slightly,
// so that immediately subscribing another observer can keep the
// subscription active.
if (sub) Promise.resolve().then(() => sub.unsubscribe());
if (sub) setTimeout(()=>{sub.unsubscribe()}, 0)
this.sub = null;
this.latest = ["error", error];
this.reject(error);
Expand Down

1 comment on commit f4ec21c

@benjamn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed soon! apollographql#8676

Please sign in to comment.