ui: [BUGFIX] Replaces destroyRecord with unloadRecord for KV 404's #5837
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.
Just because Consul gives us a 404 this doesn't guarantee the KV doesn't
exist, it doesn't even mean we don't have access to it. The behaviour also
differs depending on whether
keys
are appended to the URL or not.Furthermore, we should never destroyRecord's without user interaction
(therefore only via the
repo.delete
method).This switches destroyRecord to unloadRecord which performs the
additional legwork instead to keep ember-data in sync with the actual truth.
unloadRecord unloads the record from ember-data rather than sending an API
delete request, which would have been the intent here.
Fixes #5819Since #5888 this bugfix is no longer necessary. If a KV doesn't exist a delete does nothing, if we don't have access to a KV a delete does nothing. Both do send a HTTP request though, so the change here makes everything more 'correct', and we need to ensure that we keep ember-data in sync with the actual truth.