[Owncloud] file sharing doesn't trigger fscache update

Bjoern Schiessle schiessle at owncloud.com
Thu Jul 12 12:05:14 UTC 2012


Hi all,

I discovered a fscache problem in connection with file sharing which I
want to share wit you and get your feedback.

The first time I share a file with a user, the operation works as
expected. I think that's the case because at the first time the
Shared directory gets created  it triggers the right operation to update
the fscache.

But after that no further operation updates the fscache. Neither when I
unshare the file nor if I share additional files. That's the case
because for a virtual directory like "Shared"
OC_FilesystemView::basicOperation() never proceeds to the point where
it emits the post-hooks which would trigger the fscache update.

I think it is right to not execute the generic post hooks for the Shared
folder since the actual files aren't located there. So a lot of other
operations connected to the post hook would fail.

But this leads us to the question where to update the fscache if a
new file gets shared or a if a file gets unshared. I see two options:

1. Create special post hooks for the shared operations. This would
also allow other apps to subscribe to the same events which might be
useful in the future.

2. Instead of using hooks we could simply add/remove the new files
from the fscache directly in apps/files_sharing/lib_share.php where
also the oc_sharing table gets updated. The disadvantage here is that
fscache operations would happen in two different places.

What's your thoughts?

cheers,
Björn



More information about the Owncloud mailing list