Repository navigation
fix(graph): roll back tag assignment when TagsAdded cannot be published - #13295
Merged
Merged
Conversation
Motivation: AssignTags writes the tags to the file metadata and then publishes TagsAdded. If the publish failed, it only logged the error and answered 200. The search service learns of tag changes only through that event, so the file carried the tag while the tag list and `tag:` search never saw it. A re-index does not repair this because a tag change moves neither mtime nor etag. The DELETE handler already treats a failed publish as an error (restore previous tags, answer 500). Approach: on a failed publish, AssignTags now restores the previous tags and answers 500, mirroring publishTagsRemoved. As there, the rollback is not atomic against concurrent tag changes. Validation: added a ginkgo test in services/graph/pkg/service/v0 that makes the publisher fail and expects 500 plus a SetArbitraryMetadata call restoring the old tags. It fails without the change and passes with it. `go test ./services/graph/pkg/service/v0/` passes. I did not run the NATS-based reproduction from the issue against a live server. Report: owncloud#13286 Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Assisted-by: claude-sonnet-5-5 (via Claude Code)
✅ 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. |
LukasHirt
requested changes
Nov 2, 2026
LukasHirt
left a comment
Contributor
There was a problem hiding this comment.
Thank you for fixing this issue! Just a minor request to add the link. Btw, I have seen you've been quite active with contributions to oCIS (thank you very much for this, we appreciate this a lot!), feel free to check out the following content we're currently running - https://github.com/orgs/owncloud/discussions/22 I'd recommend to submitting your contributions there.
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Contributor
Author
|
Added the PR link above the issue link in the changelog entry. And thanks for pointing me at the discussion, I'll look through it. |
LukasHirt
approved these changes
Nov 3, 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
AssignTagsnow restores the previous tags and answers 500 when theTagsAddedevent cannot be published, mirroring whatUnassignTagsalready does forTagsRemoved. Previously it logged the error and answered 200, leaving the file tagged but missing from the tag list andtag:search.Related Issue
Motivation and Context
The search service only learns of tag changes through
TagsAdded, and re-indexing does not pick up tag-only changes, so a lost event is never repaired.How Has This Been Tested?
services/graph/pkg/service/v0with a failing publisher expects 500 and a metadata call restoring the old tags. It fails without the fix and passes with it (go test ./services/graph/pkg/service/v0/).Screenshots (if appropriate):
Types of changes
Checklist:
Fixes #13286