Skip to content

fix: 🐛 Update pdf save to use correct dav path and credentials#1414

Open
moodyjmz wants to merge 4 commits intomasterfrom
fix/dav-save-issue
Open

fix: 🐛 Update pdf save to use correct dav path and credentials#1414
moodyjmz wants to merge 4 commits intomasterfrom
fix/dav-save-issue

Conversation

@moodyjmz
Copy link
Copy Markdown

@moodyjmz moodyjmz commented Apr 10, 2026

The dav path is legacy when saving a pdf. This becomes an issue with password protected public shares.

We need to provide the request token for public

for user shares, we supply the current user id - the auth etc happens server side via session

To test this change

Place a pdf into a folder. Make this folder public, but password protected and editable.

  1. Open using the share link
  2. Edit the pdf
  3. save it.
  4. It should now save.

@icewind1991 was instrumental in pointing me in the right direction:)

Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
Comment thread src/utils/davUtils.js Outdated
}

return `/files/${getCurrentUser()?.uid}`
return davUrl + `/files/${getCurrentUser()?.uid}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should throw if this ever happens. Because otherwise it would silently resolve to /files/undefined and hide the error.

Suggested change
return davUrl + `/files/${getCurrentUser()?.uid}`
return davUrl + `/files/${getCurrentUser().uid}`

Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
@moodyjmz moodyjmz requested a review from susnux April 10, 2026 14:23
@moodyjmz
Copy link
Copy Markdown
Author

@susnux Is this ok now?

Copy link
Copy Markdown
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I still need to do a proper review, but a couple of points :-)

  • When addressing a review and fixing an issue in the original commits please use a fixup commit instead and squash the commits once the review is approved. In some cases you might need to rebase and amend the original commit if there are conflicts with later commits or you need to adjust the commit description, but at least in this specific pull request a fixup commit would be fine. Of course you can always squash the commits even if they were not originally created as fixup commits.
  • Please do not merge the latest main branch into the pull request, but rebase the commits on the latest main branch instead.

Independently of that, once the reviews are approved and the commits squashed in the PDF viewer app you will still need to build the JavaScript files. You can do that by writing a comment in GitHub with /compile /, which will trigger the compile bot and automatically add the needed files in its own commit.

If you use /compile amend / it will amend the last commit instead, but it is better to use /compile / and add the changes in its own commit to ease backports (which can be done also with GitHub comments like /backport to stable32 or, if you want that our future bot overlords see that you were already polite to them back in the day, /backport to stable32 please).

@moodyjmz
Copy link
Copy Markdown
Author

Thanks for the fix! I still need to do a proper review, but a couple of points :-)

  • When addressing a review and fixing an issue in the original commits please use a fixup commit instead and squash the commits once the review is approved. In some cases you might need to rebase and amend the original commit if there are conflicts with later commits or you need to adjust the commit description, but at least in this specific pull request a fixup commit would be fine. Of course you can always squash the commits even if they were not originally created as fixup commits.
  • Please do not merge the latest main branch into the pull request, but rebase the commits on the latest main branch instead.

Independently of that, once the reviews are approved and the commits squashed in the PDF viewer app you will still need to build the JavaScript files. You can do that by writing a comment in GitHub with /compile /, which will trigger the compile bot and automatically add the needed files in its own commit.

If you use /compile amend / it will amend the last commit instead, but it is better to use /compile / and add the changes in its own commit to ease backports (which can be done also with GitHub comments like /backport to stable32 or, if you want that our future bot overlords see that you were already polite to them back in the day, /backport to stable32 please).

Ah, cool, thanks for the pointers, I'll be sure to do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants