Skip to content

Plugin API seam: api.events.onResourceChange — a plugin can't react to pod writes #603

Description

@melvincarvalho

One of four plugin-API seams from building 33 out-of-tree plugins on the #206 loader (report). Second-most-demanded; the seam every "react to pod writes" app wants.

The gap

A plugin cannot observe pod writes, so a write-time index / cached feed / live push is impossible. Plugins do read-time work instead (walk the container per request) and eat the O(N) cost, or simply cannot offer the feature.

Consumers (7, rising sharpness)

  • notifications/ — a miss is a late notification.
  • sparql/ — a miss is a wrong query result.
  • search/ — a miss is stale results (the most user-visible instance).
  • matrix//sync?since= needs live push; a stateless bridge can only do full-state /sync without it.
  • backup/ — no change hook + no plugin-owned read authority means incremental and scheduled backup are both unbuildable.
  • jmap/ — push (eventSourceUrl) and delta sync (*/changes, Email/queryChanges) are refused in-protocol.
  • remotestorage/ — descendant-version propagation needs a write-time index.

A sharpening from sparql/'s UPDATE work: owning a write endpoint does not buy the index — a plugin could index its own writes, but plain-LDP writes bypass it, yielding a silently-wrong index. Only the host's event stream sees all writes.

Sketch

api.events.onResourceChange(({ path, method }) => {}), fired post-commit on PUT/PATCH/DELETE. Core already has the emitter internally (src/notifications/events.js) — the seam is exposure, not construction.

Cost

Small — the event stream exists; scope it and pass it through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginCould be implemented as a plugin (#206); core/plugin line defined in #564priority: mediumP2 - Do when time allows

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions