nodejs-logging-winston icon indicating copy to clipboard operation
nodejs-logging-winston copied to clipboard

fix: Fix timestamp drift due to using instanceof typeguard

Open cindy-peng opened this issue 2 years ago • 2 comments

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • [x] Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • [x] Ensure the tests and linter pass
  • [x] Code coverage does not decrease (if any source code was changed)
  • [x] Appropriate docs were updated (if necessary)

Fixes #802 🦕 This is to fix timestamp drift issue which may cause timestamp inaccuracy while using OpenTelemetry and view trace timespans. Since timestamp within metadata is defined as a union-types including null and undefined, the type guard is not necessary here.

cindy-peng avatar Nov 06 '23 21:11 cindy-peng

Can you add any tests around this? Try to make one that would fail before the change, but passes after

daniel-sanche avatar Nov 13 '23 21:11 daniel-sanche

Can you add any tests around this? Try to make one that would fail before the change, but passes after

Good suggestion. Will do!

cindy-peng avatar Nov 14 '23 23:11 cindy-peng