Page MenuHomePhabricator

[lib] Allow calling link verification from clients
ClosedPublic

Authored by tomek on Apr 19 2023, 5:10 AM.
Tags
None
Referenced Files
F1687700: D7522.diff
Wed, May 1, 6:17 AM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:21 PM
Unknown Object (File)
Wed, Apr 3, 8:14 PM
Unknown Object (File)
Feb 18 2024, 5:58 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