[eng-8074] Added an enabled true/false to prevent a race condition #2602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
The current thinking between many people Longze, Yuhuai, Ihor, etc. is other bugs that have been fixed have gradually resolved all the issues in this ticket.
The last remaining issue was this race condition that I found trying to reproduce the 8074 issue.
The "preUrl" is async and depending how quickly it resolve compared to when the user clicks on the "file widget" can recreate a race condition that the widget will not work and not display any errors either.
Summary of Changes
In the template changed the @enabled to be this.enabled
In the controller added a toggle to true/false the enabled flag until the api call has resolved.
Screenshot(s)
N/A
Side Effects
Hopefully this resolves all the preprint issues.
QA Notes
As soon as you get to the file page attempt to click on the widget. It should be "disabled" and not respond until all the information is retrieved from the server then the widget will allow for interaction.