From eafae9d0077d20e7eb6171455b7dfa91c51bacf3 Mon Sep 17 00:00:00 2001 From: Peter Ringelmann Date: Mon, 11 May 2026 21:05:19 +0200 Subject: [PATCH] fix(files_sharing): apply link share password on first save 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 --- apps/files_sharing/src/models/Share.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/files_sharing/src/models/Share.ts b/apps/files_sharing/src/models/Share.ts index b0638b29448..a861aabf88d 100644 --- a/apps/files_sharing/src/models/Share.ts +++ b/apps/files_sharing/src/models/Share.ts @@ -38,6 +38,10 @@ export default class Share { } ocsData.attributes = ocsData.attributes ?? [] + // Pre-declared so Vue 2 makes newPassword reactive at observation time, + // avoiding $set's property-addition path which races with async setters. + ocsData.newPassword = ocsData.newPassword ?? undefined + // store state this._share = ocsData } @@ -278,6 +282,18 @@ export default class Share { this._share.password = password } + /** + * Unsaved password (set during share creation or editing). + * Delegates to _share so reads/writes go through the reactive state. + */ + get newPassword(): string | undefined { + return this._share.newPassword + } + + set newPassword(value: string | undefined) { + this._share.newPassword = value + } + /** * Password expiration time * @return {string} date with YYYY-MM-DD format