Skip to content

Commit

Permalink
Fix breakage report race condition.
Browse files Browse the repository at this point in the history
Config processing can how take one tick after the config ready promise
resolves. Waiting for allLoadingFinished should ensure that everything is ready.
  • Loading branch information
sammacbeth committed Feb 5, 2025
1 parent 8e16d35 commit 53504de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shared/js/background/broken-site-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ export async function breakageReportForTab({
export async function sendBreakageReportForCurrentTab({ pixelName, currentTab, category, description, reportFlow }) {
await settings.ready();
await tdsStorage.ready('config');
// wait for onload callbacks (to ensure that config has been correctly processed)
await tdsStorage.config.allLoadingFinished

const tab = currentTab || (await tabManager.getOrRestoreCurrentTab());
if (!tab) {
Expand Down

0 comments on commit 53504de

Please sign in to comment.