Page MenuHomePhabricator

[lib] Add viewerID to DMOperationSpec.notificationsCreationData
Needs ReviewPublic

Authored by ashoat on Thu, Sep 19, 3:47 PM.
Tags
None
Referenced Files
F2771204: D13391.diff
Thu, Sep 19, 10:42 PM
F2770747: D13391.id44349.diff
Thu, Sep 19, 9:28 PM
F2770726: D13391.id.diff
Thu, Sep 19, 9:27 PM
F2770719: D13391.diff
Thu, Sep 19, 9:26 PM
F2770024: D13391.diff
Thu, Sep 19, 7:18 PM
Subscribers
None

Details

Reviewers
tomek
kamil
will
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