-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
centralize space id util functions #2816
Conversation
373ee83
to
d28813e
Compare
// "storage_id!opaque_id/path" | ||
// "storage_id/path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the opaque_id
might contain /
, eg for the localfs, which uses the path ins the fileid. we may have to change localfs to use another form of id ... it already uses sqlite. might as well use an identifier for fileid to path lookup.
I currently only see FormatReference
used in the share cache ... if so make this code a private function there. I fear people might expect to be able to parse FormatReference
back, which might not always be the case.
edit: I see FormatReference
used in owncloud/ocis#3648 ... I hope that only ends up as some form of cache key as well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have more places in the code where we manually build a storage space reference. Usually like path.Join(storageid + opaqueid, relPath)
. But I think it would be beneficial to have that logic in a function so that changing the format of the reference string is easy. That is what this function should be for. If we don't need/want it fine. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that makes sense. Maybe add this intention to the doc string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add this intention to the doc string?
I don't think we need a comment saying "Use this instead of building your own." Or do you mean something else?
d28813e
to
d0b9eff
Compare
d0b9eff
to
b3d192b
Compare
Kudos, SonarCloud Quality Gate passed! |
Merged the utility functions regarding space ids or references into one package. Also updated the functions to support the newly added provider id in the spaces id.