pico-engine icon indicating copy to clipboard operation
pico-engine copied to clipboard

Testing tab converts digit strings to a number

Open b1conrad opened this issue 1 year ago • 5 comments

Phil reported:

I have a rule that accepts an event attribute that is an identifier but looks like an 18-digit number. Like this: 830010923977419046. When I look in the logging, it comes through like this:

2023-03-23T21:56:58.348Z - EVENT clflixuzs03hf7ooicuyqgarl sensor:configuration {"iotplotter_feed_id":830010923977419000,"iotplotter_api_key":""}

Note that the last two digits are different. What I suspect is that somewhere along the line (in between the testing tab form and the event being seen by the pico, it's being treated as a number rather than a string and losing precision. For example, if I enter 830010923977419046a (note the a) then it comes through accurately.

More evidence, if I send the event using Postman, the feed ID is correctly sent and interpreted as a string.

Sure enough, a string of digits comes in as a number (not a quoted string).

it should just treat everything as a string since that's how the HTTP post will treat them.

b1conrad avatar Mar 24 '23 00:03 b1conrad