cjlawson02 / ntcore-ts-client

A TypeScript library for WPILib's NT4.1 spec
https://ntcore.chrislawson.dev
22 stars 7 forks source link

Remove unnecessary nonnegative constraint in msgPackSchema #148

Open calvin-laurenson opened 7 months ago

calvin-laurenson commented 7 months ago

From the spec

Messages shall consist of (in this order):

  • Topic/Publisher ID: unsigned integer, or -1 (RTT measurement)
  • Timestamp: integer microseconds
  • Data type: unsigned integer
  • Data value (see below)

The spec allows negative values for the timestamp. For some reason NetworkTables was sending negative timestamps for me and this fixed it. I haven't done rigorous testing but subscribers are working. The subscription is persistent which is probably related to the negative timestamp but that is an issue for WPILib.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (beta@196f50d). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## beta #148 +/- ## ======================================= Coverage ? 86.37% ======================================= Files ? 8 Lines ? 646 Branches ? 127 ======================================= Hits ? 558 Misses ? 88 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cjlawson02 commented 7 months ago

Interesting...

From their design doc:

Timestamps are specified in unsigned integer microseconds

Source

Can you open an issue with them? I'll look in their code to figure out why this is happening.

IMO the schema shouldn't be changed unless this is on purpose. You can make the change in your local node_modules in the meantime