You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #85 (PR #109). #85 routes a _shares grant/revoke event to the affected grantee's $DB/u/{grantee}/events/_shares/{id} namespace, so the grantee learns of gained/lost access without polling.
Gap
Only the grantee is notified. When an admin shares (or unshares) a resource on behalf of its owner, the resource owner is not notified that their resource's share set changed. In the common case the sharer is the owner (they initiated the share and already know), so #85 deliberately scoped notification to the grantee. But an admin-initiated share/unshare is a state change the owner may want to observe (e.g. to refresh a "shared with" list).
Where
event_recipients in crates/mqdb-agent/src/database/sharing.rs currently returns only [grantee] for a _shares event. To also notify the owner, resolve the governing resource's owner (resource_entity/resource_id are on the _shares record) and add it to the recipient list — de-duplicated, and skipping the case where the owner is the sharer to avoid a self-notification.
Considerations
Avoid notifying the owner when the owner is the one performing the share (no self-notification for the normal owner-initiated flow).
Follow-up to #85 (PR #109). #85 routes a
_sharesgrant/revoke event to the affected grantee's$DB/u/{grantee}/events/_shares/{id}namespace, so the grantee learns of gained/lost access without polling.Gap
Only the grantee is notified. When an admin shares (or unshares) a resource on behalf of its owner, the resource owner is not notified that their resource's share set changed. In the common case the sharer is the owner (they initiated the share and already know), so #85 deliberately scoped notification to the grantee. But an admin-initiated share/unshare is a state change the owner may want to observe (e.g. to refresh a "shared with" list).
Where
event_recipientsincrates/mqdb-agent/src/database/sharing.rscurrently returns only[grantee]for a_sharesevent. To also notify the owner, resolve the governing resource's owner (resource_entity/resource_idare on the_sharesrecord) and add it to the recipient list — de-duplicated, and skipping the case where the owner is the sharer to avoid a self-notification.Considerations
Acceptance
_sharesevent on their scoped namespaces.event_recipientscovering owner + grantee, and the self-share no-op.