fix(compass-global-writes): handle loading error COMPASS-8446 #6451
+235
−20
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.
Description
This one adds a LOADING_ERROR state. This state is reached whether the loading fails in the initial state (NOT_READY), or during polling (SHARDING). I have considered to simply show the toast during polling and continue with polling attempts. But seeing it in action, I think the toast isn't very clear when there was no user action, so I choose to handle both the same way (LOADING_ERROR and user has to reload). Let me know what you think about it, I'm on the edge about stopping the polling after it fails - it might be a temporary error after all.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes