Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: [BUGFIX] Replaces destroyRecord with unloadRecord for KV 404's #5837

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented May 13, 2019

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 #5819

Since #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.

@johncowen johncowen added the theme/ui Anything related to the UI label May 13, 2019
@johncowen johncowen requested a review from a team May 13, 2019 16:54
Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

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. 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 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.
@johncowen johncowen force-pushed the bugfix/write-only-kv-deletion branch from 688148f to 16631eb Compare June 4, 2019 14:01
@johncowen johncowen merged commit 8306b2f into master Jun 4, 2019
@johncowen johncowen deleted the bugfix/write-only-kv-deletion branch June 4, 2019 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Consul deletes K/V if ACL policy is key with value being a path ending in /
2 participants