Repository navigation
fix: [OCISDEV-1714] keep the role of a user when settings cannot read it - #13535
Merged
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
2403905
force-pushed
the
fix/OCISDEV-1714
branch
2 times, most recently
from
November 20, 2026 15:32
47efd81 to
6aad6fb
Compare
The settings service could remove the role of a user without an error. An empty role list makes the proxy assign the default role "User". WriteRoleAssignment deletes the old assignments first, so an Admin becomes a User. Changes: - AssignRoleToUser in services/settings/pkg/service/v0/service.go fails closed. When ListRoleAssignments returns an error, the self-assignment returns an error and does not write. - CachedMDC.SimpleDownload in services/settings/pkg/store/metadata/cache.go drops the cached listing of a folder when a file in it is gone. Another pod can change the folder, and that pod does not clear the caches of this pod. - ListRoleAssignments in services/settings/pkg/store/metadata/assignments.go reads the account folder again after a stale listing. - ListRoleAssignmentsByRole skips an account folder that is gone. Before, it returned an empty list for all accounts. reva PR #820 fixes the cause in the metadata storage: each connection error of a download became NotFound. A reva bump follows after that PR is merged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
…error Bump github.com/owncloud/reva/v2 to c9ce52c985fc. This commit is the merge of owncloud/reva#822. The new reva returns the connection error of a metadata download and no longer changes it to NotFound. Signed-off-by: Roman Perekhod <[email protected]>
2403905
force-pushed
the
fix/OCISDEV-1714
branch
from
November 20, 2026 16:17
6aad6fb to
1f963e9
Compare
2403905
enabled auto-merge (squash)
November 20, 2026 16:58
mzner
approved these changes
Nov 20, 2026
mzner
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR is the master version of #13526 (stable-8.0).
The settings service could remove the role of a user without an error:
ListRoleAssignmentsreturns an empty role list.services/proxy/pkg/userroles/defaultrole.go,UpdateUserRoleAssignment).WriteRoleAssignmentdeletes the old assignments first, so an Admin becomes a User.The main cause is in reva: each connection error of a metadata download became
NotFound. owncloud/reva#822 fixes it onmain. This PR bumps reva to that change. It also closes the other paths to the same result in the settings service.Changes
Fail closed in
AssignRoleToUser(services/settings/pkg/service/v0/service.go). A read error now returns an error, and the service does not write.Drop a stale folder listing (
services/settings/pkg/store/metadata/cache.go).CachedMDC.SimpleDownloaddrops the cached listing of the folder onNotFound.Read the folder again (
services/settings/pkg/store/metadata/assignments.go).ListRoleAssignmentsreads the account folder one more time after a stale listing.Skip only the account that is gone in
ListRoleAssignmentsByRole.Bump reva (
go.mod,go.sum,vendor/) toc9ce52c985fc. This commit is the merge of fix: [OCISDEV-1714] keep the connection error of a metadata download reva#822. Master already pins fix(appprovider): [OCISDEV-1674] open public links in read mode reva#819 and fix: [OCISDEV-1724] reuse HTTP connections in the reva clients reva#825, so the bump adds only fix: [OCISDEV-1714] keep the connection error of a metadata download reva#822.go mod tidyalso removes three old reva entries fromgo.sum.The cherry-pick from
stable-8.0had one conflict. It was in the imports ofservices/settings/pkg/service/v0/service_test.go. I kept botherrorsandfmt.Tests
TestSelfAssignFailsWhenAssignmentsCannotBeReadTestListRoleAssignmentsWithStaleDirCacheTestListRoleAssignmentsByRoleSkipsGoneAccountRelated issue
go.modof this PR pins its merge commitc9ce52c985fc.How has this been tested?
go test ./services/settings/... ./services/proxy/pkg/userroles/...passes on this branch with the new reva.CI notes
coreApiWebdavUploadTUS/lowLevelUpload.feature:58is a flaky test, and this PR does not cause it. The third PATCH can arrive before postprocessing removes the upload session. Then tusd returns 409 and not 404. The same failure occurred on branchtest/space-total-size-after-uploadwith an older reva.Types of changes
🤖 Generated with Claude Code