Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't view or remove a room from a space when it is not the latest room in the upgrade history #21732

Closed
squahtx opened this issue Apr 11, 2022 · 1 comment
Labels

Comments

@squahtx
Copy link

squahtx commented Apr 11, 2022

Steps to reproduce

  1. Create a space.
  2. Create a room. Do not add the room to the space yet.
  3. Upgrade the room: /upgraderoom 6
  4. Add the old room to the space:
    curl $'https://matrix.org/_matrix/client/r0/rooms/\u0021fhuUBbrIMGHGaPSbDk%3Amatrix.org/state/m.space.child/\u0021pLQLHMyNhDXQNFeIGr%3Amatrix.org' -X "PUT" -H "Authorization: Bearer syt_<your access token>" -H "Content-Type: application/json" --data '{"via":["matrix.org"],"suggested":false,"auto_join":false}', replacing the homeserver urls, the first room id with the space and the second room id with the old room.
    This simulates a failure during the /upgraderoom process where the old room is not removed from the space and the new room not added.
  5. Click "Manage & explore rooms" on the space
  6. Try to remove the room from the space. Element Web sends a request to remove the new room from the space instead of the old room.
  7. Click "View" on the room. An error appears in console:
    react-dom.production.min.js:101 Uncaught TypeError: Cannot read properties of undefined (reading 'canonical_alias')
        at getDisplayAliasForRoom (RoomDirectory.tsx:634:44)
        at SpaceHierarchy_showRoom (SpaceHierarchy.tsx:338:45)
        at onViewRoomClick (SpaceHierarchy.tsx:756:68)
        at onViewRoomClick (SpaceHierarchy.tsx:450:44)
        at onPreviewClick (SpaceHierarchy.tsx:114:9)
        at Object.Rb (react-dom.production.min.js:52:315)
        at Xb (react-dom.production.min.js:52:468)
        at Yb (react-dom.production.min.js:53:32)
        at Ze (react-dom.production.min.js:100:68)
        at se (react-dom.production.min.js:101:380)
    

Outcome

What did you expect?

  1. Removing the old room from the space to work.
  2. Viewing the old room from the "Manage & explore rooms" view to work.

What happened instead?

  1. Element Web tries to remove the new room from the space instead, which does nothing.
  2. An error occurs when clicking "View":
    react-dom.production.min.js:101 Uncaught TypeError: Cannot read properties of undefined (reading 'canonical_alias')
        at getDisplayAliasForRoom (RoomDirectory.tsx:634:44)
        at SpaceHierarchy_showRoom (SpaceHierarchy.tsx:338:45)
        at onViewRoomClick (SpaceHierarchy.tsx:756:68)
        at onViewRoomClick (SpaceHierarchy.tsx:450:44)
        at onPreviewClick (SpaceHierarchy.tsx:114:9)
        at Object.Rb (react-dom.production.min.js:52:315)
        at Xb (react-dom.production.min.js:52:468)
        at Yb (react-dom.production.min.js:53:32)
        at Ze (react-dom.production.min.js:100:68)
        at se (react-dom.production.min.js:101:380)
    

Operating system

Windows

Browser information

Chrome 100.0.4896.60

URL for webapp

develop.element.io

Application version

Element version: cec31d0-react-aecd71ad1523-js-286500e335e4 Olm version: 3.2.8

Homeserver

Synapse 1.56.0

Will you send logs?

No

@t3chguy
Copy link
Member

t3chguy commented Apr 11, 2022

Duplicate of #21002

@t3chguy t3chguy marked this as a duplicate of #21002 Apr 11, 2022
@t3chguy t3chguy closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants