Page MenuHomePhabricator

[lib] Add viewerID to DMOperationSpec.notificationsCreationData
ClosedPublic

Authored by ashoat on Sep 19 2024, 3:47 PM.
Tags
None
Referenced Files
F3204757: D13391.diff
Sat, Nov 9, 9:51 PM
Unknown Object (File)
Fri, Nov 1, 7:23 AM
Unknown Object (File)
Fri, Nov 1, 7:23 AM
Unknown Object (File)
Fri, Nov 1, 7:20 AM
Unknown Object (File)
Fri, Nov 1, 7:17 AM
Unknown Object (File)
Tue, Oct 22, 10:41 AM
Unknown Object (File)
Tue, Oct 22, 10:21 AM
Unknown Object (File)
Tue, Oct 22, 10:21 AM
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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

lib/shared/dm-ops/process-dm-ops.js
379–385

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