Skip to content

fix(publicshareprovider): do not fail listing public shares when the metadata space is not accessible - #996

Merged
butonic merged 2 commits into
opencloud-eu:workpackagesfrom
butonic:port-264
Nov 13, 2026
Merged

butonic merged 2 commits into
opencloud-eu:workpackagesfrom
butonic:port-264

Conversation

@butonic

@butonic butonic commented Nov 12, 2026

Copy link
Copy Markdown
Member

We now answer ListPublicShares with an OK status and no shares when the share manager reports an AlreadyExists error. That happens when the jsoncs3 public share metadata space exists but the service user cannot list it. Previously the whole request failed with an internal error, which also broke listing the members of a space.

Other errors still return an internal error, now carrying the error message instead of a generic "error listing public shares".

errtypes gains an ERR_ALREADY_EXISTS prefix constant so callers that only see a status message can detect the error. AlreadyExists messages stay unchanged.

Review focus:

  • ListPublicShares in internal/grpc/services/publicshareprovider/publicshareprovider.go: is swallowing AlreadyExists ok, and do we want the raw error message in the status?
  • AlreadyExists.Error() in pkg/errtypes/errtypes.go

Review commit by commit.

Assisted by Claude Code (claude-opus-5-5): it ported the change, wrote the adaptation commit, the specs and this description.

mklos-kw and others added 2 commits November 12, 2026 13:05
The ERR_ALREADY_EXISTS prefix dropped the space between "already
exists:" and the detail, so every AlreadyExists message changed from
"error: already exists: foo" to "error: already exists:foo". We now
append the space in Error() and keep the prefix without it, so
strings.Contains checks on the prefix still match.

Also add specs for ListPublicShares: an AlreadyExists error from the
share manager (the metadata space exists but the service user cannot
see it) yields an OK response with no shares, other errors stay an
internal error carrying the error message.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@butonic
butonic merged commit 67131be into opencloud-eu:workpackages Nov 13, 2026
20 checks passed
@openclouders openclouders mentioned this pull request Nov 13, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants