fix(files_sharing): apply link share password on first save#60311
Draft
pringelmann wants to merge 2 commits into
Draft
fix(files_sharing): apply link share password on first save#60311pringelmann wants to merge 2 commits into
pringelmann wants to merge 2 commits into
Conversation
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>
c02d642 to
34d356b
Compare
-e Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
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.
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
isPasswordProtectedsetter awaitsGeneratePasswordthen calls$set(share, 'newPassword', ...). BecausenewPasswordisn'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
newPasswordon_share(with a class getter/setter) gets Vue's observer to wire it up alongside the rest of the share state.$setthen writes through an existing reactive property and notifications go through its own dep.Checklist
3. to review, feature component)stable32)