Convert time objects to strings with nanosecond precision #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A community member followed a tutorial for setting up Twinmaker that had timestamp in unix time. They were getting duplicated results due to the plugin sending time string to GetPropertyValueHistory in string with only second precision.
When we query streaming, we set the startTime to the latest timestamp of the previous set of results. The startTime we were sending was always set to second + 0 milliseconds (second precision):
timeObject.Format(time.RFC3339)
, so it would always actually query before the last timestamp.For example, our last entry was at
2024-01-08T19:58:34.123+01:00
. The util function was parsing it into2024-01-08T19:58:34+01:00
, losing the milliseconds.When parsed into unix millisecond timestamp, the original last entry is at 1704740314123, but ours ends up being 1704740314000, before that. This is why the lambda always returns the last entry.
Which issue(s) this PR fixes:
Fixes #263
Special notes for your reviewer: