silentMode in task.ts ignored for spawnNotification if response is a string #3621
Closed
3 tasks done
Labels
question
If you are not sure how sth works or want discuss someting
Milestone
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Check our forum:
https://forum.vuestorefront.io/
Is there something you don't understand? What is it? Describe it.
I am not sure if this is a bug, or if this was done intentionally. If it was intentional then I am trying to understand why.
In core/lib/sync/task.ts#131 there is the following if statement. I split it up a lot to try and make it easier to read with all of the ands/ors and parentheses.
The piece in question is the placement of
!silentMode
. Currently, ifjsonResponse.result
is a string, thensilentMode
doesn't matter and the following code is executed, which dispatches the notification to be displayed. The placement of the check onsilentMode
only matters if the response is not a string.Why does
silentMode
not matter for string responses? Was this done for a specific reason, or was it just an oversight in the sea of parentheses that exist in this if statement?Additional information
This problem was noticed when testing the expiration of the Magento consumer token. If the initial responses are 401, an attempt to refresh the token is performed. Even if this is successful I still receive multiple notifications in the UI stating "Consumer is not authorized to access self" since Magento's initial response was this and it was returned as a string. But the refresh action was successful and those actions were retried successfully, so these notifications are confusing for the user.
The text was updated successfully, but these errors were encountered: