fix: Improve media_query retry behavior (#2603)

This commit is contained in:
Dermot Duffy
2026-07-23 22:19:17 -07:00
committed by GitHub
parent 6817d27c91
commit 54f75beb9d
10 changed files with 302 additions and 16 deletions
+9 -4
View File
@@ -218,10 +218,6 @@ export class ViewManager implements ViewManagerInterface {
},
});
this._api.getIssueManager().reset('view_incompatible');
// A new query is about to run, so any stale media_query error from a
// previous attempt is no longer meaningful. If this new query also
// fails, it will re-trigger below.
this._api.getIssueManager().reset('media_query');
} catch (e) {
if (!this._view) {
initialView = this._getFailSafeView(viewFactoryFunc);
@@ -233,6 +229,15 @@ export class ViewManager implements ViewManagerInterface {
return;
}
// A new query is about to run and is allowed to commit, so any stale
// media_query error from a previous attempt is no longer meaningful (on
// failure it re-triggers below). A retry is the exception: it re-runs the
// same failing query, so its error must persist until this attempt resolves
// rather than being cleared here and re-appearing on the next failure.
if (options?.intent !== 'retry') {
this._api.getIssueManager().reset('media_query');
}
if (this._view && this._shouldAdoptQueryAndResults(initialView)) {
initialView.query = this._view.query;
initialView.queryResults = this._view.queryResults;