nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.25k stars 4.05k forks source link

Password policy message appearing too late with enforced link shares #30318

Closed PVince81 closed 1 year ago

PVince81 commented 2 years ago

How to use GitHub

Steps to reproduce

  1. Enable the password policy app and keep the default options
  2. In the sharing settings page for admins, tick "Enforce password protection" for links
  3. Create a folder
  4. Share with link, and in the password field enter an invalid password
  5. Click the arrow to send the password

Expected behaviour

Dropdown stays open with the error message shown in a friendly way.

Actual behaviour

Dropdown closes and the error message appears as a notification at the top. And after that, it's not possible any more to click the "+" icon for creating a share, it doesn't bring back the drop down so I can't fix the password and need to refresh the page.

image

Notes

If I disable enforcement of password it works fine, the drop down stays and the error message appears in a bubble pointing at the password field.

Server configuration

Nextcloud version: v22.2.3

Updated from an older Nextcloud/ownCloud or fresh install: fresh

Where did you install Nextcloud from: git

Signing status:

Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. ```

Logs

Browser log

Browser log ``` ``` ShareRequests.js:64 Error while creating share Error: Request failed with status code 403 at t.exports (createError.js:16) at t.exports (settle.js:17) at XMLHttpRequest.p.onreadystatechange (xhr.js:62) (anonymous) @ ShareRequests.js:64 c @ runtime.js:63 (anonymous) @ runtime.js:294 (anonymous) @ runtime.js:119 Z @ files_sharing_tab.js?v=be9860c9-1:1280 s @ files_sharing_tab.js?v=be9860c9-1:1280 Promise.then (async) Z @ files_sharing_tab.js?v=be9860c9-1:1280 a @ files_sharing_tab.js?v=be9860c9-1:1280 (anonymous) @ files_sharing_tab.js?v=be9860c9-1:1280 (anonymous) @ files_sharing_tab.js?v=be9860c9-1:1280 createShare @ ShareRequests.js:56 (anonymous) @ SharingEntryLink.vue:742 c @ runtime.js:63 (anonymous) @ runtime.js:294 (anonymous) @ runtime.js:119 zt @ files_sharing_tab.js?v=be9860c9-1:1330 a @ files_sharing_tab.js?v=be9860c9-1:1330 (anonymous) @ files_sharing_tab.js?v=be9860c9-1:1330 (anonymous) @ files_sharing_tab.js?v=be9860c9-1:1330 pushNewLinkShare @ SharingEntryLink.vue:731 (anonymous) @ SharingEntryLink.vue:689 c @ runtime.js:63 (anonymous) @ runtime.js:294 (anonymous) @ runtime.js:119 zt @ files_sharing_tab.js?v=be9860c9-1:1330 a @ files_sharing_tab.js?v=be9860c9-1:1330 (anonymous) @ files_sharing_tab.js?v=be9860c9-1:1330 (anonymous) @ files_sharing_tab.js?v=be9860c9-1:1330 onNewLinkShare @ SharingEntryLink.vue:663 click @ SharingEntryLink.vue?5eab:39 Gt @ vue.runtime.esm.js:1863 n @ vue.runtime.esm.js:2188 execFirstAction @ Actions.js:66 Gt @ vue.runtime.esm.js:1863 n @ vue.runtime.esm.js:2188 Cr.o._wrapper @ vue.runtime.esm.js:6961 ```
PVince81 commented 2 years ago

when not enforced, the bubble appears in the correct place:

image

so the logic exists already but is not triggered at the right moment

also, in the latter case it was an "edit" operation because the share got created already

PVince81 commented 2 years ago

as far as I could see with a debugger: onSyncError is called correctly https://github.com/nextcloud/server/blob/master/apps/files_sharing/src/components/SharingEntryLink.vue#L784 on error and internally it's trying to reopen the dropdown but for some reason it doesn't reappear

also strange: this.createShare() is already sending a global notification so even if we catch this error it's a bit late to reopen the dialog for the additional error bubble

CarlSchwan commented 2 years ago

almost have it working

image

szaimen commented 1 year ago

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+