-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Try harder to find the host path for the documents #1571
base: main
Are you sure you want to change the base?
Conversation
f2371db
to
fd24f44
Compare
When the access to the directory is provided by the portal (like browser download directory) the stored files in the directory are not found by xdp_get_real_path_for_doc_path and /run/user/... path is opened instead of host path by the OpenFile or OpenDirectory portal. This fix tries to recreate host path from the document id and rest of the given path.
fd24f44
to
27194b7
Compare
Not a full review but changes like this really need tests. |
There are now python based tests for the document portal (#1594). Would be great if a test for the case which this PR is trying to fix was added. |
{ | ||
gchar *result; | ||
g_autofree char *host_path = xdp_get_real_path_for_doc_id (doc_id); | ||
g_autofree char *doc_path_regex = g_strconcat("/run/user/[0-9]+/doc/", doc_id, "/[^/]+(.*)", NULL); |
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 this could be avoided if xdp_looks_like_document_portal_path
would add another out param which returns the path relative to the document.
When the access to the directory is provided by the portal (like browser download directory) the stored files in the directory are not found by xdp_get_real_path_for_doc_path and /run/user/... path is opened instead of host path by the OpenFile or OpenDirectory portal.