Skip to content

feat: edit a public link on an oCIS server - #5044

Open
joragua wants to merge 9 commits into
masterfrom
feature/edit_public_link_sharing_ng
Open

joragua wants to merge 9 commits into
masterfrom
feature/edit_public_link_sharing_ng

Conversation

@joragua

@joragua joragua commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Related Issues

App: #4970

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

@joragua joragua self-assigned this Nov 4, 2026
@joragua joragua linked an issue Nov 4, 2026 that may be closed by this pull request
9 of 11 tasks
@joragua joragua closed this Nov 4, 2026
@joragua
joragua force-pushed the feature/edit_public_link_sharing_ng branch from b6802f5 to 036014d Compare November 4, 2026 12:52
@joragua joragua reopened this Nov 4, 2026
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
@joragua
joragua force-pushed the feature/edit_public_link_sharing_ng branch from 8d4f8ac to 7676799 Compare November 4, 2026 16:33
…issions

Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
…success

Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
…ace paths

Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
@joragua
joragua marked this pull request as ready for review November 6, 2026 09:09
@joragua
joragua requested a review from a team as a code owner November 6, 2026 09:09

@jesmrec jesmrec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR with just one comment.

Comment on lines +269 to +296
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 -> { }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@joragua
joragua force-pushed the feature/edit_public_link_sharing_ng branch from a5cec2a to d9cf8b8 Compare November 9, 2026 13:29
@joragua

joragua commented Nov 9, 2026 •

Copy link
Copy Markdown
Member Author

Regarding a914f8b

Consolidate edit link result handling into a single observer. Previously, success and error were split across observeEditLinkResult and observeEditPasswordLinkResult, causing a race condition on list refresh and silent failures when the link PATCH failed after a successful password update. observeEditPasswordLinkResult has been removed from both GraphShareFragment and SpaceMembersFragment

@joragua
joragua requested a review from jesmrec November 9, 2026 13:52
@joragua
joragua force-pushed the feature/edit_public_link_sharing_ng branch from d9cf8b8 to 1bda377 Compare November 10, 2026 08:12
…ink failure

Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
@joragua
joragua force-pushed the feature/edit_public_link_sharing_ng branch from 1bda377 to a914f8b Compare November 10, 2026 08:29

@jesmrec jesmrec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR Approved 🚀

Moving to QA

@jesmrec

jesmrec commented Nov 10, 2026

Copy link
Copy Markdown
Member

(1)

In a server with no mandatory password, or server with mandatory password for writeable links (using can edit)

  1. Create a link with password
  2. Click on pencil to edit the link
  3. Switch the password off
  4. Save
  5. Click on pencil to edit again

Current: Password switch enabled

Expected: Password switch disabled

Xiaomi redmi 13, Android 15
a914f8b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Sharing NG: Edit existing link

2 participants