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)
Sat, Oct 5, 9:03 PM
Unknown Object (File)
Tue, Oct 1, 9:26 PM
Unknown Object (File)
Sep 10 2024, 9:06 AM
Unknown Object (File)
Sep 10 2024, 9:06 AM
Unknown Object (File)
Sep 10 2024, 9:06 AM
Unknown Object (File)
Sep 10 2024, 9:06 AM
Unknown Object (File)
Sep 10 2024, 9:06 AM
Unknown Object (File)
Sep 10 2024, 9:02 AM
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
No Lint Coverage
Unit
No Test Coverage

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.