Skip to content

When notifyOnNetworkStatusChange is set to true and call refetch, then the network states sticks and always shows NetworkStatus.loadingΒ #1890

@dkhrunov

Description

@dkhrunov

Describe the bug

When notifyOnNetworkStatusChange is set to true and call refetch, then the network states sticks and always shows loading spinner

To Reproduce
Steps to reproduce the behavior:

  1. Create queryRef:
this.queryRef = this.readQuery.watch(variables, {
      fetchPolicy: 'cache-and-network',
      // BUG if uncomment next line, then there will be an infinite load when calling refetch
      // notifyOnNetworkStatusChange: true,
      ...readQuery?.options
    })
  1. Call refetch
this.queryRef.refetch(variables);
  1. Observe loading status
this.querying$ = this.queryRef?.valueChanges.pipe(
      map((x) => x.loading),
      distinctUntilChanged(),
      shareReplay(1)
);

Expected behavior

Then refetch complete network request loading indicator should be false

Environment:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions