Page MenuHomePhabricator

[lib] Add function to send reports
ClosedPublic

Authored by bartek on Aug 30 2023, 11:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 11:26 PM
Unknown Object (File)
Thu, Nov 7, 10:56 PM
Unknown Object (File)
Oct 30 2024, 2:55 PM
Unknown Object (File)
Oct 30 2024, 2:55 PM
Unknown Object (File)
Oct 30 2024, 2:55 PM
Unknown Object (File)
Oct 30 2024, 2:54 PM
Unknown Object (File)
Oct 30 2024, 2:54 PM
Unknown Object (File)
Oct 30 2024, 2:51 PM
Subscribers

Details

Summary

Created a function to send reports to the reports service.
We support both single or multiple reports in one request.

Depends on D9041

Test Plan

Tested in the next diff.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Aug 31 2023, 12:09 AM
bartek added inline comments.
lib/utils/reports-service.js
15 ↗(On Diff #30616)

Technically, the service accepts both object or array, but this way is easier to do the below preprocessing

tomek added inline comments.
lib/utils/reports-service.js
37–44 ↗(On Diff #30616)

It is quite surprising to see an empty catch and unconditional throw. I guess it might be less surprising to use finally

This revision is now accepted and ready to land.Aug 31 2023, 5:23 AM
lib/utils/reports-service.js
37–44 ↗(On Diff #30616)

yes it's better. Still forgetting that JS supports the finally block

Use block for error message

This revision was automatically updated to reflect the committed changes.