Page MenuHomePhabricator

Implement notificationsCreationData for chante-thread-settings-spec
AbandonedPublic

Authored by marcin on Aug 8 2024, 2:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 3:43 PM
Unknown Object (File)
Wed, Dec 18, 3:43 PM
Unknown Object (File)
Wed, Dec 18, 3:43 PM
Unknown Object (File)
Nov 18 2024, 9:53 AM
Unknown Object (File)
Nov 10 2024, 8:22 PM
Unknown Object (File)
Nov 10 2024, 2:17 PM
Unknown Object (File)
Nov 10 2024, 10:22 AM
Unknown Object (File)
Oct 18 2024, 11:26 AM
Subscribers

Details

Reviewers
kamil
tomek
ashoat
Summary

This differential implements notificationsCreationData for change-thread-settings-spec.

Test Plan
  1. Apply this small patch: https://gist.github.com/marcinwasowicz/b5a41f1ef196ee78feb0478b651b4c74
  2. Send text message
  3. Ensure that recipient is seeing two thread settings update notifications: color and name

Diff Detail

Repository
rCOMM Comm
Branch
marcin/eng-8237
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Aug 8 2024, 3:21 AM
Harbormaster failed remote builds in B31002: Diff 43251!
marcin requested review of this revision.Aug 8 2024, 3:25 AM

Why is the approach for constructing MessageData for notifs different than the approach for constructing RawMessageInfos above?

For instance, we use firstLine in one but not the other.

I strongly suspect it needs to be unified. RawMessageInfos can be constructed from MessageDatas. We should not maintain two duplicate codepaths.

Why is the approach for constructing MessageData for notifs different than the approach for constructing RawMessageInfos above?

For instance, we use firstLine in one but not the other.

I strongly suspect it needs to be unified. RawMessageInfos can be constructed from MessageDatas. We should not maintain two duplicate codepaths.

Explained in my comment: https://phab.comm.dev/D13023#368207

I saw that comment. All it does it link to some code on GitHub. I don't understand how it explains something, and especially don't understand how it responds to my comment above

I saw that comment. All it does it link to some code on GitHub on comment. I don't understand how it explains something, and especially don't understand how it responds to my comment above

It explicitly states that the logic in this diff was implemented in such a way to match to logic in the linked code. The logic in the linked code differs from the logic in the processDMOperation. Therefore this comment explains why the logic in notificationsCreationData differs from the logic in`processDMOperation`.

ashoat requested changes to this revision.Aug 8 2024, 7:26 AM

Need a deeper explanation. I think we should merge the codepaths

This revision now requires changes to proceed.Aug 8 2024, 7:26 AM

To expand on the feedback a little bit:

We should not have two separate codepaths for generating RawMessageInfo – one from notifs (where it starts as a MessageData) and one for content.

There should be only one version of a RawMessageInfo for a given message ID. The approach you've taken is problematic for many reasons, but the most obvious is that these messages get merged in the MessageStore both from notifs and from Tunnelbroker, but the way you're constructing them means it will be different from the two different sources.

In your recent work, I've noticed a pattern of "copy-paste" instead of "merge and factor". I understand you're trying to move fast, but you're currently not thinking nearly enough about the implications of your decisions to fork codepaths.

An ideal solution here would not only make sure that we have only one way to generate a MessageData / RawMessageInfo for thick threads, but would go further and also deduplicate it with the code you linked that handles thin threads.

If this feedback is confusing, I'd suggest syncing with @tomek first to try and understand it before responding further.

Need a deeper explanation. I think we should merge the codepaths

The code in processDMOperations constructs MessageData using name and color properties as they are. The keyserver code when handling change thread settings request first calls firstLine on name and toLower on color before constructing MessageData that are further used to send notifs. I wanted notificationsCreationData to match the keyserver behaviour.

I am not able to give deeper explanation than this since there is no additional logic there. I am fine with merging the codepaths if we don't require that notificationsCreationData doesn't match keyserver logic.

Ideally all three should match up. See my most recent comment

Ideally all three should match up. See my most recent comment

Noted. I will make sure that MessageData in each path are created according to what relevant keysever endpoint responder does.