We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0ec869 commit 9082011Copy full SHA for 9082011
packages/runtime-common/indexer.ts
@@ -1098,7 +1098,13 @@ export class Batch {
1098
}
1099
1100
1101
- private async calculateInvalidations(alias: string): Promise<string[]> {
+ private async calculateInvalidations(
1102
+ alias: string,
1103
+ visited: string[] = [],
1104
+ ): Promise<string[]> {
1105
+ if (visited.includes(alias)) {
1106
+ return [];
1107
+ }
1108
let childInvalidations = await this.client.itemsThatReference(
1109
alias,
1110
this.realmVersion,
@@ -1109,7 +1115,9 @@ export class Batch {
1115
...invalidations,
1116
...flatten(
1111
1117
await Promise.all(
1112
- aliases.map((alias) => this.calculateInvalidations(alias)),
1118
+ aliases.map((a) =>
1119
+ this.calculateInvalidations(a, [...visited, alias]),
1120
+ ),
1113
1121
),
1114
1122
1123
];
0 commit comments