Page MenuHomePhabricator

[lib] Allow calling link verification from clients
ClosedPublic

Authored by tomek on Apr 19 2023, 5:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 12:59 PM
Unknown Object (File)
Mon, Oct 28, 1:26 AM
Unknown Object (File)
Mon, Oct 28, 1:26 AM
Unknown Object (File)
Mon, Oct 28, 1:26 AM
Unknown Object (File)
Mon, Oct 28, 1:26 AM
Unknown Object (File)
Mon, Oct 28, 1:25 AM
Unknown Object (File)
Mon, Oct 28, 1:18 AM
Unknown Object (File)
Tue, Oct 22, 11:42 AM
Subscribers

Details

Summary

This diff adds some code that allows calling link verification endpoint.

Depends on D7521

Test Plan

Tested in combination with next diffs - every call from link handler (introduced later) verifies this code.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Apr 19 2023, 5:29 AM
lib/actions/link-actions.js
21 ↗(On Diff #25337)

It seems we usually don't return right away, but do something like

const response = await callServerEndpoint('verify_invite_link', request);
return {
  field: response.field;
  ...
};

I'm not sure why, probably so that the potential type errors are thrown from here, and not later. Can you follow the same pattern or explain why it's not needed please?

This revision is now accepted and ready to land.Apr 21 2023, 2:25 AM
lib/actions/link-actions.js
21 ↗(On Diff #25337)

You're right. The purpose of this pattern is that the result of callServerEndpoint could have more fields, e.g. success. We don't want these fields further down.

Don't return response directly