Page MenuHomePhabricator

[lib] fix changing thread description on native for thick threads
ClosedPublic

Authored by kamil on Tue, Sep 24, 5:35 AM.
Tags
None
Referenced Files
F2842656: D13447.id44483.diff
Sun, Sep 29, 3:11 PM
F2842197: D13447.diff
Sun, Sep 29, 12:27 PM
F2841715: D13447.id44482.diff
Sun, Sep 29, 10:58 AM
F2837609: D13447.diff
Sat, Sep 28, 7:10 PM
Unknown Object (File)
Sat, Sep 28, 2:39 PM
Unknown Object (File)
Sat, Sep 28, 8:24 AM
Unknown Object (File)
Wed, Sep 25, 12:05 AM
Unknown Object (File)
Wed, Sep 25, 12:05 AM
Subscribers
None

Details

Summary

ENG-9316.

The description is a nullable field (link), so whenever clicking editing button for not edited or not set description here it causes changing value from undefined to undefined and a result nothing changes. We're not entering this branch which renders TextInput.

For thin threads, it works only because for some reason keyserver is replacing undefined description with an empty string here.

The alternative solution is to create a thick thread with an empty string as a description (instead of undefined), but I don't like this because types still allow for descryption to be nullable so this bug might be caused again in the future.

Test Plan
  1. Change thread settings on native works for thin and thick threads.
  2. Notifs works.
  3. Changing the description to the same value is a no-op.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Tue, Sep 24, 5:37 AM
kamil edited the summary of this revision. (Show Details)
kamil edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Tue, Sep 24, 5:39 AM
native/chat/settings/thread-settings-description.react.js
231 โ†—(On Diff #44482)

Wondering if this won't result in sending operations that replace null with '' - after clinking the input and accepting changes.

add empty string as default description

native/chat/settings/thread-settings-description.react.js
231 โ†—(On Diff #44482)

As we disccussed offline - this causes an empty update (without robotext), so avoid that we're gonna match what the keyserver is doing and fill not not-defined description with an empty string in the thread creation spec.