Page MenuHomePhabricator

[lib] Match thread types in pendingToRealizedThreadIDsSelector
ClosedPublic

Authored by ashoat on Oct 1 2024, 6:40 AM.
Tags
None
Referenced Files
F3359150: D13557.diff
Sun, Nov 24, 7:32 AM
Unknown Object (File)
Tue, Nov 19, 8:09 AM
Unknown Object (File)
Sun, Nov 10, 4:21 PM
Unknown Object (File)
Fri, Nov 8, 10:39 PM
Unknown Object (File)
Fri, Nov 8, 3:00 AM
Unknown Object (File)
Fri, Nov 8, 3:00 AM
Unknown Object (File)
Fri, Nov 8, 3:00 AM
Unknown Object (File)
Fri, Nov 1, 4:46 PM
Subscribers
None

Details

Summary

This addresses ENG-9451, which was caused by D13404.

Before that diff, we would only match a pending thread ID to a realized thread if the thread type matched.

In that diff, we wanted to relax this condition a little bit so that a pending thick thread would match a realized thin thread, and vice versa.

However, we didn't consider a scenario where somebody creates a LOCAL thread and then somebody else leaves. In this case, the use of pendingThreadType(actualMemberIDs.length - 1, thickOrThin) would return a different thread type than the current thread's.

This diff replaces the usage of pendingThreadType, and brings back the old behavior of checking the realized thread type. However, we make sure to include both thin and thick thread types for each realized thread.

Depends on D13553

Test Plan

I recreated the test case in the Linear task as follows:

  1. Create three accounts A, B, and C
  2. Make A friends with B and C
  3. Have A create a chat with B and C
  4. Have B leave the chat
  5. Have A search for C. Confirm that a pending personal thick thread appears in the results, and when it's pressed we no longer navigate to the test chat mentioned above

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat published this revision for review.Oct 1 2024, 6:40 AM
tomek added inline comments.
lib/selectors/thread-selectors.js
475–488 ↗(On Diff #44751)

We can use constants that are defined next to the used functions

This revision is now accepted and ready to land.Oct 1 2024, 8:28 AM