Page MenuHomePhabricator

Remove 3rd node-fetch package and use native API instead
ClosedPublic

Authored by marcin on Jul 28 2023, 6:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 27, 9:44 AM
Unknown Object (File)
Fri, Dec 27, 9:44 AM
Unknown Object (File)
Fri, Dec 27, 9:44 AM
Unknown Object (File)
Fri, Dec 27, 9:44 AM
Unknown Object (File)
Fri, Dec 27, 9:44 AM
Unknown Object (File)
Fri, Dec 27, 9:43 AM
Unknown Object (File)
Fri, Dec 27, 9:33 AM
Unknown Object (File)
Fri, Dec 6, 10:58 PM
Subscribers

Details

Summary

As of the parent differential we no longer have to use 3rd party node-fetch API since its
enchanced version comes embedded within node v18. This differential removes this package from the project
and replaces its useges with native API.

Test Plan

Tried sending messages to windows app and they were received correctly. Confirmed that the keyserver obtained WNS token correctly.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Rebase to update commit message

keyserver/src/push/utils.js
370 ↗(On Diff #29167)

In node-fetch result.headers.get('....') is typed as string, while in native node-fetch it is typed as null | string. Therefore without this invariant return type of wnsPush would be violated as it expects wnsID property to be always string.

package.json
56 ↗(On Diff #29167)

If anyone gets confused the reason for this changed has been explained previously: https://phab.comm.dev/D8529?id=28774#inline-54808

michal edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Aug 1 2023, 9:35 AM