Skip to content

Commit

Permalink
PB-984: Not sending warnings when not necessary
Browse files Browse the repository at this point in the history
Issue : in some cases, warnings or errors could be sent when unnecessary, as the router would loop more than once when mutations occur, and thus go through the URL query watcher. This was most visible with local external layers, which would be checked when not needed (for example, when switching from 2d to 3d).

Fix : If the value in the store is the same as the one in the query, we no longer validate the input.
  • Loading branch information
ltkum committed Oct 8, 2024
1 parent babc675 commit 56c4b9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/router/storeSync/abstractParamConfig.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export default class AbstractParamConfig {
}

const queryValue = query[this.urlParamName]
if (store) {
// we don't need to validate again if the content of the store is the same as the query
// we need the store check to avoid self recursion
if (store && this.valuesAreDifferentBetweenQueryAndStore(query, store)) {
let inputValidation = this.validateUrlInput
? this.validateUrlInput(store, queryValue)
: { valid: true }
Expand Down

0 comments on commit 56c4b9b

Please sign in to comment.