Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
d014a27 to
635d5a9
Compare
Member
Author
|
/compile / |
Member
Author
|
/backport to stable33 please |
Member
Author
|
/backport to stable32 please |
artonge
reviewed
Apr 30, 2026
Collaborator
artonge
left a comment
There was a problem hiding this comment.
Looks good, any reason this is still a draft?
Member
Author
I forgot to mention it in the pull request description, sorry 🤦 I kept it as a draft to ensure that it would not be merged before rebasing first onto master (as it is currently based on #3475, but that is something independent). Great, and now I undrafted it by mistake with the touchpad 😅 Anyway, as it has conflicts I will rebase onto master and recompile. |
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The "public.php/dav" endpoint from server is not compatible with the tokens used for public albums by the Photos app, but they work fine with the "remote.php/dav" endpoint. By default @nextcloud/files/dav uses "public.php/dav" for remote URLs in public pages, so they need to be explicitly replaced with "remote.php/dav" (which is the one already used for non public pages, so it is fine to use it unconditionally). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
c0f04be to
3d20af2
Compare
Member
Author
|
/compile / |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
artonge
approved these changes
Apr 30, 2026
susnux
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3442, which is a regression introduced in 4a65c8c
When a file is open in the viewer the Photos app provides an object with the file information. The object includes the
sourceattribute, which is used to get the URL to download the file open in the viewer.Before 4a65c8c the
sourcewas created by appending the file name (/photospublic/TOKEN/FILE) to the remote DAV URL (https://DOMAIN/remote.php/dav). In 4a65c8c1b7b8f5016d1189a0f4eb403be77bfaee instead of the remote DAV URL defined in the app the default remote URL provided by@nextcloud/files/davis used, which in the case of public pages ishttps://DOMAIN/public.php/dav. However, the file name is not just appended to the default remote URL, but generated through a URL object. As the file name is relative to the root only the site part of the base URL is used (in this case, the default remote URL), so the final "assembled" URL becomeshttps://DOMAIN/photospublic/TOKEN/file.A bit later, in 999d49b,
genFileInfowas replaced withresultToNodefrom@nextcloud/files/dav, which composes thesourceattribute by appending the file name to the default remote URL, so it becomeshttps://DOMAIN/public.php/dav/photospublic/TOKEN/FILE. While it is now using a "valid" Nextcloud URL the shared files can not be downloaded from it.The problem with
/public.php/davis that it can be used only for "normal" public shares, as it uses a custom DAV server that does not load the additional authentication backends and always uses the public DAV authentication, which treats the token as a share token and therefore fails. On the other hand,/remote.php/davuses a full DAV server, which loads the additional authentication backends and therefore allows access to/photospublic/URLs.While it might make sense to explicitly support additional authentication backends in
/public.php/davI am not familiar with any of this to know if it would be the right approach or not. Moreover, the DAV client used for public albums explicitly uses/remote.php/davrather than the default remote URL (/public.php/dav), so for now the provided fix just passes/remote.php/davtoresultToNodewhen generating the album node. Note that there are otherresultToNodecalls throughout the code, although I only touched the one that fixes the reproduction steps below (and the added E2E test). It might be necessary to change others as well.Another possibility to fix this without explicitly passing the remote URL would have been to remove the
isPublicelement from the template, so@nextcloud/filesdoes not replaceremote.phpwithpublic.php. However, conceptually it makes sense to provide theisPublicelement.But, moreover, that seems to actually be a brittle hack. Apparently the
isPublicelement would still be needed inPhotosAppPublic.vue(not only based on the comment, but also because if it is removed the public share no longer works); I have not digged into why that one is not used by@nextcloud/files, or why the one in the template is not used by whatever uses the one inPhotosAppPublic.vue, but it seems that the element from the template is used only during the app startup or something like that 🤔Independently of that, note that CI will keep failing until the breaking API change in server is fixed, either by merging #3475 or by adjusting the API change in server to be backwards compatible. For now this pull request is just based on #3475 to be able to run the tests.
How to test
Result with this pull request
The photo is download
Result without this pull request
A 503 Service Unavailable error is returned