Skip to content

feat(events): emit ArbitraryMetadataUpdated on SetArbitraryMetadata#712

Open
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:feature/metadata-change-event
Open

feat(events): emit ArbitraryMetadataUpdated on SetArbitraryMetadata#712
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:feature/metadata-change-event

Conversation

@flash7777

Copy link
Copy Markdown

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:

  • ArbitraryMetadataUpdated event type in pkg/events/metadata.go
  • Conversion function in eventsmiddleware/conversion.go
  • SetArbitraryMetadataResponse case in the events interceptor

The 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. SetArbitraryMetadata was 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

  • Builds clean against current main
  • Deployed and tested on kosmos instance (cloud.brandis.eu)
  • Verified PROPPATCH returns 207 OK with patched build
  • Verified ListContainerStream also works (both patches deployed together)
  • OpenCloud search service needs to subscribe to the new event (separate OpenCloud PR)

Note

The OpenCloud search service (services/search/pkg/service/event/service.go) needs a companion change to subscribe to ArbitraryMetadataUpdated and trigger IndexSpace. That will be a separate OpenCloud PR.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant