HomePhabricator
Diffusion Comm f4e5cf0e3d3c

[web][native] Always generate key from keyIndex in RobotextMessage

Description

[web][native] Always generate key from keyIndex in RobotextMessage

Summary:
I noticed in ChangeSettingsMessageSpec that we use the same key for the thread entity that we use for the color entity (in the case of a thread color changing).

This is technically not an issue because we never render a ThreadEntity that points to the current thread. Both RobotextMessage in web and InnerRobotextMessage on native have this behavior.

That said, I think it's pretty sketchy to be relying on not seeing eg. two instances of the same entity in a single robotext. We already have a keyIndex mechanism in this code that guarantees unique keys... let's just always use that.

Depends on D6504

Test Plan: Flow, making sure robotext messages still render on native and web

Reviewers: atul

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D6505

Details

Provenance
ashoatAuthored on Feb 1 2023, 5:29 AM
Reviewer
atul
Differential Revision
D6505: [web][native] Always generate key from keyIndex in RobotextMessage
Parents
rCOMM2d527cea677d: [native] Add some memoization to InnerRobotextMessage
Branches
Unknown
Tags
Unknown