Can't remove shared namespace with user that has apostroph in his name #1224

Closed
opened 2022-07-29 08:31:49 +00:00 by Bouni · 8 comments

Version information:

Frontend Version: 0.18.2
API Version: v0.18.1
Browser and OS Version: Firefox 103.0 (64-bit) / Windows 10

Steps to reproduce:

  1. Add a User with an apostroph in his name (SXXXXXX D'Urso in my case, name redacted for privacy)
  2. Share a namespace with that user
  3. Try to delete that share

Expected behavior:

Share is removed

Actual behavior:

I get this error message:

Error
Request failed with status code 404
The user does not exist.

Checklist:

  • I have provided all required information
  • I am using the latest release or the latest unstable build
  • I was able to reproduce the bug on try
<!-- Please fill out this issue template to report a bug. If you want to propose a new feature, please open a discussion thread in the forum: https://community.vikunja.io --> **Version information:** Frontend Version: 0.18.2 API Version: v0.18.1 Browser and OS Version: Firefox 103.0 (64-bit) / Windows 10 **Steps to reproduce:** <!-- Add clear steps to reproduce the bug. Provide screenshots where applicable. --> 1. Add a User with an apostroph in his name (SXXXXXX D'Urso in my case, name redacted for privacy) 2. Share a namespace with that user 3. Try to delete that share **Expected behavior:** Share is removed **Actual behavior:** I get this error message: ``` Error Request failed with status code 404 The user does not exist. ``` **Checklist:** * [x] I have provided all required information * [x] I am using the latest release or the latest unstable build * [x] I was able to reproduce the bug on [try](https://try.vikunja.io)
Author

I looked a bit deeper into it and the problem seems to be the URL encoding of the link, so might be a frontend issue rather than a API issue.

This is the URL I see when I try to delete the share:

http://todo.elektro.ch/api/v1/namespaces/4/users/SXXXXXXX%20D'Urso

If I urlencode the same link with one of the numerous online URL encoders, I get

http://todo.elektro.ch/api/v1/namespaces/4/users/SXXXXXXX%20D%27Urso

The ' seems not to be encoded

I looked a bit deeper into it and the problem seems to be the URL encoding of the link, so might be a frontend issue rather than a API issue. This is the URL I see when I try to delete the share: `http://todo.elektro.ch/api/v1/namespaces/4/users/SXXXXXXX%20D'Urso` If I urlencode the same link with one of the numerous online URL encoders, I get `http://todo.elektro.ch/api/v1/namespaces/4/users/SXXXXXXX%20D%27Urso` The `'` seems not to be encoded
Author

I did another test, I resent the DELETE request using my browsers dev tools and edited the URL by replacing ' with %27 and that did the trick!

I did another test, I resent the DELETE request using my browsers dev tools and edited the URL by replacing `'` with `%27` and that did the trick!
konrad added the
kind/bug
label 2022-07-31 16:42:32 +00:00
Owner

Looks like this is a problem from the space in the username, not the apostroph.

Looks like this is a problem from the space in the username, not the apostroph.
Owner

Fixed in 8f27e7e619 - please test with the next unstable build if it fixes your issue.

Fixed in https://kolaente.dev/vikunja/api/commit/8f27e7e619ac73716211d838f52c73d7d97aead5 - please test with the next unstable build if it fixes your issue.
Author

I'm on vacation, will test next week when I'm back 👍

I'm on vacation, will test next week when I'm back 👍
Member

Maybe I'm missing something here but: Shouldn't the api request encode the user in the first place?

Maybe I'm missing something here but: Shouldn't the api request encode the user in the first place?
Owner

@dpschen The frontend did encode it but the api didn't encode it correctly.

@dpschen The frontend did encode it but the api didn't encode it correctly.
Author

@konrad Solves my issue! Thank you for your fast response!

@konrad Solves my issue! Thank you for your fast response!
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1224
No description provided.