Repository navigation
fix: wait for the sidebar resource before rendering the shares panel - #3639
Open
fredrikblau wants to merge 1 commit into
Open
fredrikblau wants to merge 1 commit into
fredrikblau wants to merge 1 commit into
Conversation
On a fresh load of the Spaces page, the space's graph permissions are not loaded yet, so FileSideBar awaits them before setting the sidebar resource. The panels stay mounted under the loading overlay during that wait, so opening the members panel from a space tile rendered SpaceMembers with a null resource and crashed in canShare. Show the loader until the resource is set. Fixes opencloud-eu#3574
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On a fresh load of the Spaces page, clicking "Show members" on a space tile crashed the sidebar with
Cannot read properties of null (reading 'canShare').The cause is the order in which the sidebar loads. The tile button selects the space and opens the
space-sharepanel in one step. That space'sgraphPermissionsaren't loaded yet: theselectedResourcesIdswatcher inProjects.vuehas only just started loading them. So theFileSideBarwatcher awaitsloadGraphPermissionsTaskbefore it callssetLoadedResource. The loading overlay inSideBarPanelsdoesn't unmount the panels, soSharesPanelrendersSpaceMembersduring that await with the injectedresourcestillnull. The other entry points (space ⋮ → Members, the header link, Details → Members) select the space first, so its permissions are already loaded and the resource is set without waiting.SharesPanelnow shows its existing loader until the sidebar resource is set. The fix sits inSharesPanelrather than inSpaceMembersoruseCanShare, so it also coversFileSharesandFileLinks, which read the same injected resource.Related Issue
How Has This Been Tested?
pnpm test:unit packages/web-app-files/tests/unit/components/SideBar/Shares/SharesPanelspec,resourceinjected asref(null)withshowSpaceMembers: the loader is shown andspace-membersisn't rendered. Fails without the change.SharesPanel,SpaceMembers,FileSharesandFileLinksspecs still pass (153 tests).vue-tsconweb-app-filesreports only the 3 errors that are already onmain.Types of changes