Skip to content

Conversation

@skjnldsv
Copy link
Member

Summary

The sidebar action is returning a promise, we should await so our own exec also returns the proper value.
This fixes some edge case where opening the sharing options leave the loading indicator spinning

Checklist

@skjnldsv skjnldsv added this to the Nextcloud 32 milestone Aug 13, 2025
@skjnldsv skjnldsv self-assigned this Aug 13, 2025
@skjnldsv skjnldsv requested a review from a team as a code owner August 13, 2025 13:21
@skjnldsv skjnldsv added the bug label Aug 13, 2025
@skjnldsv skjnldsv requested review from susnux and removed request for a team August 13, 2025 13:21
@skjnldsv skjnldsv added the 3. to review Waiting for reviews label Aug 13, 2025
@skjnldsv skjnldsv requested review from nfebe and sorbaugh August 13, 2025 13:21
@skjnldsv
Copy link
Member Author

@susnux I wonder why my linter haven't caught this 🤔
I figured the failed return Promise return type should throw an error, no ?

CarlSchwan
CarlSchwan previously approved these changes Aug 13, 2025
@susnux

This comment was marked as resolved.

@CarlSchwan CarlSchwan dismissed their stale review August 13, 2025 15:32

last comment

@skjnldsv

This comment was marked as resolved.

@skjnldsv skjnldsv force-pushed the fix/sharing-status-action-sidebar-promise-return branch 3 times, most recently from 35792c9 to 4437aad Compare August 14, 2025 20:08
@skjnldsv skjnldsv requested review from CarlSchwan and susnux and removed request for sorbaugh August 14, 2025 20:08
@skjnldsv
Copy link
Member Author

Resolved, this should be better.
I also took the opportunity to fix the OCA typings of the Sidebar

@skjnldsv skjnldsv requested a review from a team as a code owner August 14, 2025 20:10
@skjnldsv skjnldsv requested review from leftybournes and removed request for a team August 14, 2025 20:10
@skjnldsv skjnldsv force-pushed the fix/sharing-status-action-sidebar-promise-return branch 2 times, most recently from f284f57 to 2a14928 Compare August 20, 2025 14:20
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/sharing-status-action-sidebar-promise-return branch from 2a14928 to 1b2d81a Compare August 20, 2025 14:21
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/sharing-status-action-sidebar-promise-return branch from 1b2d81a to ce41a2d Compare August 20, 2025 14:21
@skjnldsv
Copy link
Member Author

/compile

Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ Needs to be added to the release script

if ((node.permissions & Permission.READ) !== 0) {
window.OCA?.Files?.Sidebar?.setActiveTab?.('sharing')
return sidebarAction.exec(node, view, dir)
sidebarAction.exec(node, view, dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO its better to await it here so that we can trust all work is done and not pending branches exist

Suggested change
sidebarAction.exec(node, view, dir)
await sidebarAction.exec(node, view, dir)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought about it, I kinda thought I would be confortable awaiting for the sidebar when we'll have it properly re-written with the right api and Node usage 🙈

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@skjnldsv skjnldsv enabled auto-merge August 20, 2025 17:32
@skjnldsv skjnldsv merged commit d5417d6 into master Aug 21, 2025
201 of 203 checks passed
@skjnldsv skjnldsv deleted the fix/sharing-status-action-sidebar-promise-return branch August 21, 2025 09:24
@skjnldsv
Copy link
Member Author

/backport 9404059 to stable31

@skjnldsv
Copy link
Member Author

/backport 9404059 to stable30

@skjnldsv
Copy link
Member Author

/backport 9404059 to stable29

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants