Skip to content

fix: persist customized file request share tokens - #64575

Open
mvanhorn wants to merge 1 commit into
nextcloud:masterfrom
mvanhorn:fix/60144-file-request-share-token-persistence
Open

mvanhorn wants to merge 1 commit into
nextcloud:masterfrom
mvanhorn:fix/60144-file-request-share-token-persistence

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Add token persistence to the existing parameterized update query in apps/sharebymail/lib/ShareByMailProvider.php, using the supplied share's getToken() alongside the other persisted fields. Apply this consistently to email-backed shares: the existing API already accepts custom tokens for both TYPE_LINK and TYPE_EMAIL, and the thread's suggestion that email token immutability is intentional is a participant's hypothesis rather than a documented restriction in the inspected code. Extend the existing database-backed ShareByMailProviderTest::testUpdate coverage, explicitly providing the original or replacement token on share fixtures and checking the stored value; add a file-request-shaped case with a folder, CREATE permission, empty recipient, and file-request attributes.

Customizing a File Request token returns apparent success and changes the displayed link, but the persisted share retains its previous token. The reporter reproduced this on Nextcloud 33, and another participant confirmed it on version 34 and a beta. File requests created with mail sharing enabled use TYPE_EMAIL even without a recipient, so their updates reach ShareByMailProvider rather than the link-share provider. The API sets the requested token on the share object, but ShareByMailProvider::update() returns that object without writing its token to the database.

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes
    Not verified: this needs a person on the named hardware or environment.
  • Documentation (manuals or wiki) has been updated or is not required
  • Backports requested where applicable (ex: critical bugfixes)
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
    Not run: no test command resolved in this workspace, so nothing was executed to pass.
  • Milestone added for target branch/version (ex: 32.x for stable32)
    Not run: no test command resolved in this workspace, so nothing was executed to pass.

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

AI was used for assistance.

@mvanhorn
mvanhorn requested a review from a team as a code owner September 20, 2026 05:38
@mvanhorn
mvanhorn requested review from Altahrim, come-nc, icewind1991 and leftybournes and removed request for a team September 20, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Customizing a File Request share token updates the UI but does not persist the new token

2 participants