Skip to content

fix(files_sharing): apply link share password on first save#60311

Draft
pringelmann wants to merge 2 commits into
masterfrom
fix/57011/share-password-reactivity
Draft

fix(files_sharing): apply link share password on first save#60311
pringelmann wants to merge 2 commits into
masterfrom
fix/57011/share-password-reactivity

Conversation

@pringelmann
Copy link
Copy Markdown
Contributor

Summary

Setting a password on a public link share doesn't always apply on the first save. The input shows a value but the create-share request drops the password; you have to toggle "Set password" off and on, or save twice, for it to stick.

The isPasswordProtected setter awaits GeneratePassword then calls $set(share, 'newPassword', ...). Because newPassword isn't on the share at observation time, this goes through Vue 2's property-addition path, which only notifies renders subscribed to the parent's __ob__.dep. Whether the field's render is in that subscriber set depends on prop-access ordering at first read. Customer/enterprise builds land on the broken side; some dev setups don't, which is why this has been hard to reproduce.

Pre-declaring newPassword on _share (with a class getter/setter) gets Vue's observer to wire it up alongside the rest of the share state. $set then writes through an existing reactive property and notifications go through its own dep.

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
  • 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)
  • Milestone added for target branch/version (ex: 32.x for stable32)

@pringelmann pringelmann self-assigned this May 11, 2026
Pre-declare newPassword on the share state so Vue 2's reactivity covers
it from the start. Without this, $set later relies on a
property-addition notification path that races with the toggle's async
setter and intermittently drops the password in certain build
environments.

Fixes: #57011
-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the fix/57011/share-password-reactivity branch from c02d642 to 34d356b Compare May 11, 2026 19:10
@pringelmann pringelmann added this to the Nextcloud 34 milestone May 11, 2026
-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
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.

[Bug]: Adding a password to a share is not effective unless saved twice

1 participant