-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tolerate undefined
concast.sources
if complete
called early.
Fixes issue #10262, since `this.sources.shift()` throws when `complete` is called called before the `Promise` that should have initialized `this.sources` resolves, which can happen when the directive combination `@client @export(as: ...)` is used, because `@export` usage causes a `Promise<Observable[]>` to be passed to the `Concast` constructor instead of the `Observable[]` itself. Although passing a `Promise` to the `Concast` constructor should work, we only exercise that code path in one place, and the additional wrinkle of calling `complete` before the `Promise` resolves was never tested: https://github.com/apollographql/apollo-client/blob/015a1ffff3febe4604956f4bb137a3111f3d8257/src/core/QueryManager.ts#L1226-L1241
- Loading branch information
Showing
2 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters