Skip to content

Conversation

@t3chguy
Copy link
Member

@t3chguy t3chguy commented Jan 12, 2026

Split out from #5136

I suggest reviewing commits to get some context

Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
This test failed when ran individually, same as after the clearAllMocks call

Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
@t3chguy t3chguy added the T-Task Tasks for the team like planning label Jan 12, 2026
@t3chguy t3chguy self-assigned this Jan 12, 2026
@t3chguy t3chguy marked this pull request as ready for review January 12, 2026 11:52
@t3chguy t3chguy requested review from a team as code owners January 12, 2026 11:52
Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed breakdown and descriptions. Makes the review easier.
Just some non-blocking comments

fetchMock.get("path:/_matrix/client/v3/room_keys/version", testData.SIGNED_BACKUP_DATA);

const rustCrypto = await makeTestRustCrypto(makeMatrixHttpApi());
await expect(rustCrypto.getKeyBackupInfo()).resolves.toStrictEqual(testData.SIGNED_BACKUP_DATA);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like toStrictEqual is asserting more tham toMatchObject? any reason to relax the requirement?

Copy link
Member Author

Choose a reason for hiding this comment

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

With vitest it was failing with Serializes to same value


expect(groupCall.screenshareFeeds).toStrictEqual(newFeeds);
expect(currentFeed.dispose).toHaveBeenCalled();
expect(newFeed.measureVolumeActivity).toHaveBeenCalledWith(true);
Copy link
Member

Choose a reason for hiding this comment

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

Good catch. It is legacy calling? wonder if we shouldn't create an issue to track that this test was only passing due to side effect of other test

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking through the code it looks like measureVolumeActivity doesn't apply to screenshare streams

// Then it disappears from the thread and appears in the main timeline
expect(ev.threadRootId).toBeUndefined();
expect(mainTimelineLiveEventIds(room)).toEqual([threadRoot.getId(), ev.getId()]);
expect(mainTimelineLiveEventIds(room)).toEqual([threadRoot.getId(), ev.getId(), redaction.getId()]);
Copy link
Member

Choose a reason for hiding this comment

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

That is strange.. Isn't it more that redaction.getId() is undefined?
like expect([1,2]).toEqual([1,2, undefined]);

Maybe these test could use things like expect.arrayContaining([threadRoot.getId(), ev.getId()]) ?

Copy link
Member Author

@t3chguy t3chguy Jan 12, 2026

Choose a reason for hiding this comment

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

Yes, redaction before this PR had an undefined ID which jest allows you to skip in toEqual - vitest was unhappy and I thought that given real redactions have event IDs it'd make sense to make them have IDs in test too and assert them correctly

arrayContaining wouldn't assert order


it("should copy state from previous timeline", async function () {
// XXX: This test was previously not running and it is broken
it.skip("should copy state from previous timeline", async function () {
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, is there a task to investigate if this is important or not?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not from me, all the tests in this weird suite weren't running at all so this is preferable than removing them all to match the prior reality

@andybalaam andybalaam requested review from andybalaam and removed request for kaylendog and richvdh January 13, 2026 14:56
@t3chguy t3chguy added this pull request to the merge queue Jan 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 13, 2026
@t3chguy t3chguy added this pull request to the merge queue Jan 13, 2026
Merged via the queue into develop with commit b3fedf3 Jan 13, 2026
41 checks passed
@t3chguy t3chguy deleted the t3chguy/prepare-vitest branch January 13, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants