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)
Thu, Nov 14, 1:01 PM
Unknown Object (File)
Thu, Nov 14, 1:00 PM
Unknown Object (File)
Mon, Nov 11, 3:18 AM
Unknown Object (File)
Tue, Oct 29, 4:06 PM
Unknown Object (File)
Tue, Oct 22, 10:44 AM
Unknown Object (File)
Tue, Oct 22, 10:19 AM
Unknown Object (File)
Sun, Oct 20, 7:46 PM
Unknown Object (File)
Sun, Oct 20, 7:46 PM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #43890)

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 ↗(On Diff #43890)

Should we add this invariant for thin sidebars too?

native/input/input-state-container.react.js
512–525 ↗(On Diff #43890)

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 ↗(On Diff #43890)

Same question here

web/input/input-state-container.react.js
1340–1343 ↗(On Diff #43890)

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 ↗(On Diff #43890)

Thank you!