Page MenuHomePhabricator

[lib][web][native] Update createRealThreadFromPendingThread to handle thick thread creation
ClosedPublic

Authored by inka on Sep 5 2024, 1:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 5:10 AM
Unknown Object (File)
Sat, Dec 7, 7:04 AM
Unknown Object (File)
Nov 20 2024, 11:18 AM
Unknown Object (File)
Nov 20 2024, 11:18 AM
Unknown Object (File)
Nov 20 2024, 11:18 AM
Unknown Object (File)
Nov 14 2024, 1:01 PM
Unknown Object (File)
Nov 14 2024, 1:00 PM
Unknown Object (File)
Nov 11 2024, 3:18 AM
Subscribers

Details

Summary
Test Plan

Tested by setting usingOlmViaTunnelbrokerForDMs to true. Not setting this flag yet, because it has other effects.
Tested that a thick thread gets created on both web and native.

Tested that if the flag is set to false, thin threads are created correctly

There is a problem with navigation - on both platfrms when the thick thread is created the user is not navigate to it. Instead they stay in the pending thread. I will address that in ENG-9147

Diff Detail

Repository
rCOMM Comm
Branch
inka/thread_ops
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Sep 5 2024, 1:38 AM
inka edited the test plan for this revision. (Show Details)
tomek added inline comments.
native/input/input-state-container.react.js
470

Should we mention that this is an operation that sends a text message?

This revision is now accepted and ready to land.Sep 6 2024, 7:16 AM
lib/shared/thread-actions-utils.js
105–108

Should we add this invariant for thin sidebars too?

native/input/input-state-container.react.js
512–525

What do you think of extracting these lines to a separate function? Lines 516-525 are already repeated on 585-594, and you're adding some more repeated code here

web/input/input-state-container.react.js
1323–1336

Same question here

web/input/input-state-container.react.js
1340–1343

I guess this is causing this bug: ENG-9187.

In the previous revision, it worked because my version was early exiting no matter if the thread was pending or not.

This code is executed for thick threads also, so you create local entries with different IDs (messageInfo has localID, but for DMs, we're using a different uuid.v4, lines above). Later on, you early-exit before calling dispatchActionPromise so there is an entry in local which never gets removed.

We should make sure that for thick threads we only use processAndSendDMOperation and not dispatch any other action (other actions are thin threads related). Worth checking other places that could possibly be affected.

Address review, fix but from ENG-9187

web/input/input-state-container.react.js
1340–1343

Thank you!