Open Salipa-Gurung opened 2 months ago
This is somewhat expected behaviour. If an item is deleted, the resourceID cannot be retrieved any more (because the item is gone). Hence this field is omitted in the activity.
Note that the Delete
activity is a special case because the event already holds the correct ID. But that information is obsolete as the client cannot do anything with the resourceID (as the item was deleted)
When a file is created, renamed and followed by moving it inside a folder then only the last activity (ie. moving the file inside a folder) will have a resource id and all other previous activities will have empty resource id. How about this behaviour? Is this behaviour expected or not? cc: @kobergj
How about this behaviour? Is this behaviour expected or not?
No. The itemid doesn't change when a file is moved. This is a bug imo.
only the latest action activity has the value in the resource id:
"resource": {
"id": "{resource-id}"
I double checked. This is because the events do not contain the itemid but only a reference (containing a path).
The fix to this is rather expensive. There are two options:
A) We pass the itemID through the opaque until the events middleware. This brings some challenges. See for example discussion on this PR: https://github.com/cs3org/reva/pull/4767
B) We get rid of the events middleware and emit events at the place they are created in. This will bring code duplication (e.g. posixfs and decomposedfs both need to emit some events).
Both options are rather costly. I wouldn't want to tackle it without a proper plan.
Fix depends on priority.
Describe the bug
For activities api: GET
/v1beta1/extensions/org.libregraph/activities
, resource id is missing for file creation event when activity is checked after deleting the file.Steps to reproduce
For the file upload event, we receive an empty string in the resource id that previously contained the id when checking activity after file deletion.
Expected behavior
There should be resource id.
Actual behavior
Resource id is missing.