Page MenuHomePhabricator

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

Authored by kamil on Sep 24 2024, 5:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 2:14 PM
Unknown Object (File)
Fri, Nov 1, 2:14 PM
Unknown Object (File)
Fri, Nov 1, 2:14 PM
Unknown Object (File)
Fri, Nov 1, 2:14 PM
Unknown Object (File)
Fri, Nov 1, 2:14 PM
Unknown Object (File)
Mon, Oct 21, 7:01 PM
Unknown Object (File)
Mon, Oct 21, 5:26 AM
Unknown Object (File)
Mon, Oct 21, 12:47 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
Branch
fixes-3
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Sep 24 2024, 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.Sep 24 2024, 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.