Page MenuHomePhabricator

[lib] Add viewerID to DMOperationSpec.notificationsCreationData
ClosedPublic

Authored by ashoat on Sep 19 2024, 3:47 PM.
Tags
None
Referenced Files
F3520233: D13391.id44369.diff
Sun, Dec 22, 11:40 PM
F3520048: D13391.id44349.diff
Sun, Dec 22, 11:17 PM
F3517997: D13391.diff
Sun, Dec 22, 6:52 PM
Unknown Object (File)
Mon, Nov 25, 4:23 PM
Unknown Object (File)
Nov 20 2024, 10:13 AM
Unknown Object (File)
Nov 20 2024, 10:13 AM
Unknown Object (File)
Nov 13 2024, 8:53 PM
Unknown Object (File)
Nov 9 2024, 9:51 PM
Subscribers
None

Details

Summary

We need to get viewerID in there, since we need it to populate targetID of UpdateRelationshipMessageData.

Depends on D13390

Test Plan

For now, just Flow. I'll test this at a later point in the stack; for now, putting up diffs following the team's recent pattern to get feedback

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/shared/dm-ops/process-dm-ops.js
379–385 ↗(On Diff #44349)

Talked to @kamil about this check. Here's what he had to say:

Hey, I was thinking about this a bit and my first idea was to put this check here, after generating messages and then return all IDs of generated messages as failed. However, looking deeper, when there is no viewerID we not generate messages anyway so I think we can just return empty array here and should be fine

On the other hand, it will be strange case to send composable messages when there is no viewer so I think invariant could work too

I decided to go with an empty array because I'd rather avoid crashing the app with an invariant. Ultimately it's probably a scenario that we never suspect to occur

LGTM but suggesting alternative approach:

I am also thinking about adding viewerID to ProcessDMOperationUtilities, as it seems like the right place to put it and could simplify it, curious also for @tomek's perspective.

This revision is now accepted and ready to land.Sep 20 2024, 1:41 AM

I am also thinking about adding viewerID to ProcessDMOperationUtilities, as it seems like the right place to put it and could simplify it, curious also for @tomek's perspective.

Yeah, I think it could make sense - we usually use 1 or 3 parameters, so having the viewerID in utils should simplify things a little.

Makes sense, I had the same thought. I'll make that change in a separate diff, as I think it will affect a lot more files

Going to land this now even though it hasn't been tested. This is in keeping with our strategy this month of "land quickly, test later" :)

LGTM but suggesting alternative approach:

I am also thinking about adding viewerID to ProcessDMOperationUtilities, as it seems like the right place to put it and could simplify it, curious also for @tomek's perspective.

D13412