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: XHR keys need to include the method as well #4319

Merged
merged 3 commits into from
May 25, 2018

Conversation

DingoEatingFuzz
Copy link
Contributor

The URL alone doesn't guarantee uniqueness. This caused a bug where stopping a job (DELETE /v1/job/:id) and reading a job (GET /v1/job/:id) could abort one another.

@@ -49,9 +49,9 @@ export default Watchable.extend({
xhrKey(url, method, options = {}) {
const namespace = options.data && options.data.namespace;
if (namespace) {
return `${url}?namespace=${namespace}`;
return `${method} ${url}?namespace=${namespace}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Dunno why but I'm always wary of using%20spaces in keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

URL encoding haunts all our dreams.

To be honest, I want to rip all this stuff out and replace it with some form of cancellation token like axios uses.

@@ -51,8 +51,8 @@ export default ApplicationAdapter.extend({
return ajaxOptions;
},

xhrKey(url /* method, options */) {
return url;
xhrKey(url, method /* options */) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice that these were already being passed 👌

@@ -49,9 +49,9 @@ export default Watchable.extend({
xhrKey(url, method, options = {}) {
const namespace = options.data && options.data.namespace;
if (namespace) {
return `${url}?namespace=${namespace}`;
return `${method} ${url}?namespace=${namespace}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would appending to this._super(...arguments) work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely would.

@DingoEatingFuzz DingoEatingFuzz merged commit 20bc6e4 into master May 25, 2018
@DingoEatingFuzz DingoEatingFuzz deleted the b-ui-errant-acl-error branch May 25, 2018 19:24
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants