Repository navigation
feat(OCISDEV-945): DeleteStorageSpace: return typed result carrying SpaceName and FinalMembers - #622
Conversation
✅ 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. |
SummaryThe DeleteStorageSpace flow previously relied on a couple of awkward patterns to ferry data from the storage driver up to the events interceptor — before every delete, storageprovider.DeleteStorageSpace issued a ListStorageSpaces call to discover the space's name and grants, then stuffed those into DeleteStorageSpaceResponse.Opaque["spacename"] and Opaque["grants"] for the events interceptor to read back. It worked, but it cost an extra round-trip on every delete and was stringly-typed all the way through. This PR replaces them with a typed return value. storage.FS.DeleteStorageSpace now returns a *storage.DeleteStorageSpaceResult alongside the error. The struct carries the two pieces of information the events interceptor needs: type DeleteStorageSpaceResult struct {
SpaceName string
FinalMembers map[string]provider.ResourcePermissions
}Drivers that have rich data (decomposedfs, and posix via embedding) populate the result before the destructive purge runs, drivers that don't return nil and the conversion layer falls back gracefully when building the event. Either way, the published SpaceDeleted payload stays structurally identical to before. Acceptance criteria
Test plan
|
2403905
left a comment
There was a problem hiding this comment.
Let's simplify the readFinalMembers description
…paceName and FinalMembers
DeleteStorageSpace now returns a DeleteStorageSpaceResult. When purging, decomposedfs captures the space name and the active members before it deletes anything, and the events middleware builds SpaceDeleted from that instead of the response opaque. Disabling returns an empty result. Differences to upstream: - the storageprovider still lists the space first, so non-members keep getting a not found, and it still fills the response opaque. Drivers without a result fall back to that opaque for SpaceDeleted. - decomposedfs does not emit SpaceMembershipExpired while collecting the final members. In our tree the share manager emits that event, and the purge removes expired grants together with the space anyway. Expired grants are just left out. - a failure to list the grants now aborts the purge instead of only being logged, we need them for the event. backport of owncloud#622 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
No description provided.