-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The existing implementation for `datamap.setFloat` mistakenly attempted to use the second argument as both the value to add to the map and the map to add it to. This resulted in an "Invalid argument" error thrown when trying to cast the value as a map. The tests for `Data.generate` tested sending floating point values to the agent using the value `99.0`. Since JavaScript has a unified `number` type for integers and floats alike, `99.0` is the same number as `99`. The implementation of `Data.generate` decides whether to call `datamap.setInteger` or `datamap.setFloat` based on whether `Number.isInteger` returns `true` or `false` -- and it will return `true` for `99.0`, as it would for `99`. This means that, in practice, `datamap.setFloat` was not covered by the tests.
- Loading branch information
Showing
3 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
packages/nodejs/.changesets/allow-sending-non-integer-values-in-data-maps.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: "patch" | ||
type: "fix" | ||
--- | ||
|
||
Fix an issue where the AppSignal extension would throw an error when an object containing a non-integer number is sent to it. This would be triggered when calling `setSampleData` with an object containing a non-integer number, or when the values for a metric's tags are non-integer numbers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters