Page MenuHomePhabricator

[lib] Match thread types in pendingToRealizedThreadIDsSelector
ClosedPublic

Authored by ashoat on Tue, Oct 1, 6:40 AM.

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat published this revision for review.Tue, Oct 1, 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.Tue, Oct 1, 8:28 AM