Skip to content

Internal - Room Search Fix#721

Open
nushea wants to merge 1 commit intoSableClient:devfrom
nushea:Thorping
Open

Internal - Room Search Fix#721
nushea wants to merge 1 commit intoSableClient:devfrom
nushea:Thorping

Conversation

@nushea
Copy link
Copy Markdown
Contributor

@nushea nushea commented Apr 28, 2026

Description

Fixes the rerender cycle by making it sure it redoes the math if the state changes instead

It doesn't have or need a changelog as it is a bug encountered only in the dev branch

Fixes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

The callas disregard for the state of the room compelled and educated in writing the pr 😔😔😔

@nushea nushea requested review from 7w1 and hazre as code owners April 28, 2026 02:30
@7w1 7w1 added the internal label Apr 28, 2026
Copy link
Copy Markdown
Member

@7w1 7w1 left a comment

Choose a reason for hiding this comment

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

how tf does this fix it lol what did we break

@nushea
Copy link
Copy Markdown
Contributor Author

nushea commented Apr 28, 2026

how tf does this fix it lol what did we break

i honestly am not completely sure either, i just tried to nail it with git blame for some 2h and couldnt get it, then i started playing around at random with the code and found that allRooms kept rerendering, but only when it had a toSorted function, so
(original code)

const allRooms = useAtomValue(allRoomsAtom).toSorted(factoryRoomIdByActivity(mx));

if you remove the toSorted

const allRooms = useAtomValue(allRoomsAtom);

it doesnt trigger the issue, it works
but it doesnt matter what is in the sort either for it to break and cause rerenders so sth like

const allRooms = useAtomValue(allRoomsAtom).toSorted((a, b) => a.length - b.length);

which is a nothingburger sorting, it still crashes

@7w1
Copy link
Copy Markdown
Member

7w1 commented Apr 28, 2026

lovely
i love typescript/javascript/react/web dev so fun so flawless makes so much sense

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants