 Change ListNotificationState to store room ids (#9518)
 Change ListNotificationState to store room ids (#9518)

* Changed ListNotificationState to store room ids

ListNotificationState stores a reference to a rooms array which is later
used for comparing the stored array with new arrays. However, the
comparison may fail since the stored array can be changed outside the
class. This PR proposes to instead store only the room ids, which
hopefully allows to avoid the issue by copying the room ids into
a new array, while still being performant.

Signed-off-by: a414d24c809fd017f55a0b247b5948a3b7e8823e@yahoo.de

* Change ListNotificationState to shallow clone rooms

Instead of using room ids like in the previous commit,
shallow clone the rooms array instead.

Signed-off-by: a414d24c809fd017f55a0b247b5948a3b7e8823e@yahoo.de
Co-authored-by: Robin <474ee9ee179b0ecf0bc27408079a0b15eda4c99d@robin.town>
matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk