feat(events): emit ArbitraryMetadataUpdated on SetArbitraryMetadata#712
Open
flash7777 wants to merge 1 commit into
Open
feat(events): emit ArbitraryMetadataUpdated on SetArbitraryMetadata#712flash7777 wants to merge 1 commit into
flash7777 wants to merge 1 commit into
Conversation
…data SetArbitraryMetadata (used by WebDAV PROPPATCH and the Graph Metadata API) did not emit any event, which meant downstream consumers like the search indexer were never notified about metadata changes. This caused the search index to become stale after custom metadata was set. Changes: - Add ArbitraryMetadataUpdated event type in pkg/events/metadata.go - Add conversion function in eventsmiddleware/conversion.go - Register SetArbitraryMetadataResponse in the events interceptor The event includes the list of changed metadata keys and follows the same pattern as FileTouched, ContainerCreated, etc.
2 tasks
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.
Summary
SetArbitraryMetadata(used by WebDAV PROPPATCH and the Graph Metadata API) did not emit any event via the events middleware interceptor. This meant downstream consumers like the search indexer were never notified about custom metadata changes, causing the search index to become stale.This adds:
ArbitraryMetadataUpdatedevent type inpkg/events/metadata.goeventsmiddleware/conversion.goSetArbitraryMetadataResponsecase in the events interceptorThe event includes the list of changed metadata keys and follows the same pattern as
FileTouched,ContainerCreated, etc.This is a companion to the existing metadata PRs (#693, #696) that improved PROPFIND/PROPPATCH metadata handling — this patch closes the gap on the event side.
Motivation
All other write operations (upload, delete, move, touch, lock) emit events that allow the search service and other consumers to react.
SetArbitraryMetadatawas the only write operation missing from the interceptor. Without this event, custom metadata set via PROPPATCH is invisible to the search index until the next full space re-index.Test plan
Note
The OpenCloud search service (
services/search/pkg/service/event/service.go) needs a companion change to subscribe toArbitraryMetadataUpdatedand triggerIndexSpace. That will be a separate OpenCloud PR.