Skip to content

Commit

Permalink
[BUG] Remote Dependency requests don't "always" have the correct ai.o…
Browse files Browse the repository at this point in the history
…peration.id tag (page view race condition) #1862 (#1869)
  • Loading branch information
MSNev committed Aug 1, 2022
1 parent 200e0f1 commit 9176bc3
Show file tree
Hide file tree
Showing 10 changed files with 398 additions and 83 deletions.
10 changes: 6 additions & 4 deletions AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,10 +864,12 @@ export class SnippetInitializationTests extends AITestClass {
// Setup Sinon stuff
const appInsights = (snippet as any).appInsights;
this.onDone(() => {
if (snippet["unload"]) {
snippet["unload"](false);
} else if (snippet["appInsightsNew"]) {
snippet["appInsightsNew"].unload(false);
if (snippet) {
if (snippet["unload"]) {
snippet["unload"](false);
} else if (snippet["appInsightsNew"]) {
snippet["appInsightsNew"].unload(false);
}
}
});

Expand Down
19 changes: 11 additions & 8 deletions common/Tests/Framework/src/AITestClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export class AITestClass {
}

protected onDone(cleanupFn: VoidFunction) {
if (cleanupFn) {
if (cleanupFn && this._onDoneFuncs) {
this._onDoneFuncs.push(cleanupFn);
}
}
Expand Down Expand Up @@ -892,14 +892,17 @@ export class AITestClass {
}

private _testFinishedCleanup() {
this._onDoneFuncs.forEach((fn) => {
try {
fn();
} catch (e) {
// Do nothing during cleanup
}
});
let doneFuncs = this._onDoneFuncs;
this._onDoneFuncs = [];
if (doneFuncs) {
doneFuncs.forEach((fn) => {
try {
fn();
} catch (e) {
// Do nothing during cleanup
}
});
}

this.testFinishedCleanup();
}
Expand Down
84 changes: 42 additions & 42 deletions common/config/rush/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9176bc3

Please sign in to comment.