fix: Improve media_query retry behavior (#2603)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user