fix: use NodeID instead of SpaceID for UploadReady event resource_id#12057
fix: use NodeID instead of SpaceID for UploadReady event resource_id#12057paul43210 wants to merge 3 commits intoowncloud:masterfrom
Conversation
The UploadReady event and upload-finished callback both set FileRef.ResourceId.OpaqueId to session.SpaceID() instead of session.NodeID(). Every upload reports the space root UUID as the file identifier rather than the actual file's node ID. Upstream: owncloud/reva#546 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With OpaqueId now pointing directly to the file node, the Path field is redundant and causes CODE_NOT_FOUND: NodeFromResource resolves the node from OpaqueId then tries to walk the Path from that node, which fails because a file node cannot have children. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5c43147 to
0e3f91e
Compare
|
|
Closing this PR — after further investigation, the original In a CS3 What looked like a bug ( Setting The |



Summary
The
UploadReadyevent and upload-finished callback both setFileRef.ResourceId.OpaqueIdtosession.SpaceID()instead ofsession.NodeID(), and include an unnecessaryPathfield. Every upload reports the space root UUID as the file identifier rather than the actual file's node ID.Problem
Two locations in decomposedfs construct a
Referencewith the wrongOpaqueId:decomposedfs.go:393(UploadReady event):upload.go:104(upload-finished callback):The correct pattern is already used in the
FinishUpload()return value (upload.go:117):Why remove Path?
With
OpaqueIdpointing directly to the file node, thePathfield is redundant. Worse, leaving it causesCODE_NOT_FOUNDerrors:NodeFromResource()resolves the node fromOpaqueId, then tries to walk thePathfrom that node. Since a file node cannot have children, walking./dir/filename.extfrom a file node fails.Evidence
From a NATS consumer monitoring UploadReady events, every upload has
opaque_id == space_id:16 consecutive uploads confirmed — all affected regardless of file type or size.
Impact
Currently low — all existing oCIS consumers (search, postprocessing, activitylog, clientlog) either ignore the
OpaqueId, extract only theSpaceId, or resolve the file via thePathfield. However, any consumer that trustsResourceId.OpaqueIdto identify the uploaded file gets the space root instead.Changes
vendor/.../decomposedfs/decomposedfs.goSpaceID()→NodeID(), removedPathin UploadReady eventvendor/.../decomposedfs/upload.goSpaceID()→NodeID(), removedPathin upload-finished callbackchangelog/unreleased/fix-uploadready-resource-id.mdTest plan
CODE_NOT_FOUNDerrors in logsUpstream reva PR: owncloud/reva#546
Fixes: #12056
🤖 Generated with Claude Code