Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Allow creating permalinks for unknown predecessor rooms (even though unlikely to be successful) #10113

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/components/views/messages/RoomPredecessorTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ export const RoomPredecessorTile: React.FC<IProps> = ({ mxEvent, timestamp }) =>
}

const prevRoom = MatrixClientPeg.get().getRoom(predecessor.roomId);
if (!prevRoom) {
logger.warn(`Failed to find predecessor room with id ${predecessor.roomId}`);
return <></>;
}
const permalinkCreator = new RoomPermalinkCreator(prevRoom, predecessor.roomId);
permalinkCreator.load();
if (prevRoom) {
permalinkCreator.load();
} else {
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId}, unlikely to be successful`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId}, unlikely to be successful`);
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId}, it's possible that this room doesn't actually exist but we will give the user what they want`);

Copy link
Contributor

@MadLittleMods MadLittleMods Feb 8, 2023

Choose a reason for hiding this comment

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

Alternative and probably more accurate than my first suggestion:

Suggested change
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId}, unlikely to be successful`);
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId}, unlikely to be routable on its own without via servers but we will give the user what they want`);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId}, unlikely to be successful`);
logger.warn(`Creating permalink for unknown predecessor room ${predecessor.roomId},`+
'unlikely to be successful as rooms without via servers are usually not routable');

Copy link
Contributor

Choose a reason for hiding this comment

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

The phrasing here makes successful ambiguous about what will be successful. It kinda makes it seem like creating the permalink is unlikely to be successful.

Whereas I think we're trying to explain that a permalink for a random room ID is unlikely to get the user to right place.

}
let predecessorPermalink: string;
if (predecessor.eventId) {
predecessorPermalink = permalinkCreator.forEvent(predecessor.eventId);
Expand Down