Repository navigation
feat: edit a public link on an oCIS server - #5044
Conversation
b6802f5 to
036014d
Compare
8d4f8ac to
7676799
Compare
| private fun observeEditLinkResult() { | ||
| collectLatestLifecycleFlow(publicLinksViewModel.editLinkResultFlow) { event -> | ||
| event?.peekContent()?.let { uiResult -> | ||
| when (uiResult) { | ||
| is UIResult.Loading -> { } | ||
| is UIResult.Success -> { | ||
| if (publicLinksViewModel.addPublicLinkUIState.value?.wasPasswordChanged != true) { | ||
| graphShareViewModel.getGraphShares() | ||
| showMessageInSnackbar(getString(R.string.public_link_edit_correctly)) | ||
| } | ||
| publicLinksViewModel.resetViewModel() | ||
| } | ||
| is UIResult.Error -> { } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private fun observeEditPasswordLinkResult() { | ||
| collectLatestLifecycleFlow(publicLinksViewModel.editPasswordLinkResultFlow) { event -> | ||
| event?.peekContent()?.let { uiResult -> | ||
| when (uiResult) { | ||
| is UIResult.Loading -> { } | ||
| is UIResult.Success -> { | ||
| graphShareViewModel.getGraphShares() | ||
| showMessageInSnackbar(getString(R.string.public_link_edit_correctly)) | ||
| } | ||
| is UIResult.Error -> { } |
There was a problem hiding this comment.
If both password and other field change, observers handle information separately, so, we'll see two snackbars, one for the password, another for the other fields. Same for the getGraphShares call. Is that correct or am i missing something?
OTOH, if password request fails, will the editLink request be launched?
There was a problem hiding this comment.
Only one snackbar will appear in the screen. The PATCH is not triggered unless the POST (password operation) success. If the password request fails, the editLink will not be launched
a5cec2a to
d9cf8b8
Compare
|
Regarding a914f8b Consolidate edit link result handling into a single observer. Previously, success and error were split across |
1bda377 to
a914f8b
Compare
(1) [FIXED]In a server with no mandatory password, or server with mandatory password for writeable links (using can view)
Current: Password switch enabled Expected: Password switch disabled Xiaomi redmi 13, Android 15 |
|
(1) should be fixed with the commit c22c4c6
|
(2) (regression) [WONT FIX]In a server with mandatory password for writeable links:
Current: Expected: Public link created because new permission allows to create with no password Reproducible also in spaces' links. It's a regression since it is also reproducible in Xiaomi redmi 13, Android 15 |
|
(2) is won't fix as expected behaviour. Firstly, the password request is sent as an empty password without the permission change sent (PATCH comes later), so, the error is because the password cannot be removed. Race condition caused by the separated request to update password, on one side, and the other fields, on the other side. |
|
Approved on my side |
Signed-off-by: Jorge Aguado Recio <[email protected]>
…issions Signed-off-by: Jorge Aguado Recio <[email protected]>
Signed-off-by: Jorge Aguado Recio <[email protected]>
Signed-off-by: Jorge Aguado Recio <[email protected]>
Signed-off-by: Jorge Aguado Recio <[email protected]>
…success Signed-off-by: Jorge Aguado Recio <[email protected]>
…ace paths Signed-off-by: Jorge Aguado Recio <[email protected]>
Signed-off-by: Jorge Aguado Recio <[email protected]>
…ink failure Signed-off-by: Jorge Aguado Recio <[email protected]>
…ord changes Signed-off-by: Jorge Aguado Recio <[email protected]>
c22c4c6 to
fcc2268
Compare
Signed-off-by: Jesus Recio <[email protected]>
Related Issues
App: #4970
ReleaseNotesViewModel.ktcreating a newReleaseNote()with String resources (if required)QA
Test plan: https://github.com/owncloud/QA/blob/android/sharing_ng/Mobile/Android/Executions/Release_4.9/NG%20-%20Edit%20link.md