Repository navigation
Labels
Description
JIRA: #OCISDEV-37
Describe the bug
I changed my locale in the web UI from english to german and then back to english and even though the Accept-Language header is correctly set to en, the permissions endpoint returns share roles in german...
Steps to reproduce
- Change locale in web UI into german
- Change locale back into english
- Go to files list and try to share a file
Expected behavior
Roles are in english
Actual behavior
Roles are in german
Setup
Additional context
This is the request:
curl $'https://host.docker.internal:9200/graph/v1beta1/drives/d757b907-73a5-4847-8e2f-a80dad47e72b%24b1ec0786-e329-404e-9378-38d4a2396f4f/items/d757b907-73a5-4847-8e2f-a80dad47e72b%24b1ec0786-e329-404e-9378-38d4a2396f4f\u00212434ee18-205c-4fcd-be4d-0b08e18786fa/permissions' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en' \
-H 'authorization: Bearer eyJhbGciOiJQUzI1NiIsImtpZCI6InByaXZhdGUta2V5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJ3ZWIiLCJleHAiOjE3Mzk4NzU2OTAsImlhdCI6MTczOTg3NTM5MCwiaXNzIjoiaHR0cHM6Ly9ob3N0LmRvY2tlci5pbnRlcm5hbDo5MjAwIiwianRpIjoidzQ3Q0NtSFVYNDVKREdBWmVnQ3o1VjF5Zk9yX2MxMnQiLCJsZy5pIjp7ImRuIjoiQWRtaW4iLCJpZCI6Im93bkNsb3VkVVVJRD1iMWVjMDc4Ni1lMzI5LTQwNGUtOTM3OC0zOGQ0YTIzOTZmNGYiLCJ1biI6ImFkbWluIn0sImxnLnAiOiJpZGVudGlmaWVyLWxkYXAiLCJsZy50IjoiMSIsInNjcCI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIiwic3ViIjoiSUlzWUR3Z0tmMHVvVUpqV0BJLTJVR2J5M2ZpWTYtWGlKaFo1bXRrNVNEbWgtNXlleVJjQ21PMTJqUk9Qd203cnBsSE9LcFQtcWdzQUpxUW80VkpuRm5nIn0.COeTKb9mel_SK9eVLDFFn6Z2_w7_sadedsZC7sg8NlhnMdUbgBDETCPMxIPoKK3VK5J_CJHepWKFC10X3XHapycQkzGZJ-u4tf_3IqULqnwB_sTvtzlJOPjOAOPdw1t0tB5es3prlnR2KP19FbNV4iBwxaIVJkE-UjtEmEWFzT7DNxzk_jJYqAbg6_3bLobIdmOMLhPHBCjHjYH5jDXzuQiNl_SfsJFy4Gag9peq0Wqv9ewnC5KVoy1IRzKeqBF-_OSRQIZHSwYeu0DVrMj6cq_GN7UKUGOrtPnrjRhkpuhV8VUD1aKHCgJ3U1GPwtlB9Iwel7iJ8icKwe3a2bEGNrf-uYafA5G9SUSnyvjcwSMsf0RqeWJv1ptXM_90PFcV3owelF75W8GmQ5Cs2ktf3XOtQpMDRpPRXj5u1im7vXNXkX6-FxqtHKAh6QhcXC3WXkYwojkEOhfxqmkxtrbCP0Z-fhA9ghC2ufPd16fn4u1QGedqOiWbTf19r-nETrE-k9ErIXTF56hfH9NVZ-nIfnb3oUDpYaRqpMhlBhYGq0Llqo85_cX-HM8kIkwvjLpU_odU3guFdd1ebNaNVRpdexutG9FZT97usZmMIgDqTXwoePoI1-TOTIrSCydxg-hLj995ofFZmzY6tTivBo7ucZmaDt0oo4Y9RaKpnzlGU-8' \
-H 'cache-control: no-cache' \
-H 'initiator-id: 40a2c918-63c3-43f1-95f1-39719292648b' \
-H 'origin: https://host.docker.internal:9201' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://host.docker.internal:9201/' \
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-site' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
-H 'x-request-id: e316598f-9d32-4827-b960-f674a6de82ef' \
-H 'x-requested-with: XMLHttpRequest'Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone

Activity
LukasHirt commentedon Feb 22, 2025
The only way I can get the roles translated again in english is to restart the oCIS server.
2403905 commentedon Mar 12, 2025
Can't reproduce.
dj4oC commentedon Apr 16, 2025
I can confirm.
LukasHirt commentedon Apr 16, 2025
I tested this now as well again with latest master and can still reproduce by the steps in the description.
LukasHirt commentedon Apr 16, 2025
Just noticed that it is not only issue with going back to English. Anytime I switch to any locale, then the share roles are stuck in that locale.
Reproduction steps:
My current hunch is that when the translations happen here https://github.com/owncloud/ocis/blob/master/services/graph/pkg/service/v0/api_driveitem_permissions.go#L805 the roles definition maybe gets overwritten from translatable string to the translated string and that's why next time it's not translated?
LukasHirt commentedon Apr 16, 2025
Yep, seems to be the case with overwriting the source string
ocis/ocis-pkg/l10n/l10n.go
Line 321 in 7947c99
LukasHirt commentedon Apr 16, 2025
I just did one extra test to see whether the translatable strings are really being overwritten.
adminENDEDEeinsteineinsteinhas locale set toEN, see roles inDEZaznam.obrazovky.2025-04-16.v.22.48.14.mov
This seems to confirm my hunch and also shows that the issue is a bit bigger as a single user changing his locale affects all other users...
2403905 commentedon Apr 16, 2025
@LukasHirt I updated the pr.
Ocis used the global slice
buildInRolesof roles and tried to clone the slice each time. But theslices.Clonefunction doesn't work properly, that why the transaction overwrites roles globally.ocis/services/graph/pkg/unifiedrole/roles.go
Line 204 in 20f32d4
ocis/services/graph/pkg/unifiedrole/filter.go
Line 39 in 20f32d4