Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert time objects to strings with nanosecond precision #264

Merged
merged 1 commit into from Jan 10, 2024

Conversation

idastambuk
Copy link
Contributor

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 into 2024-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:

@idastambuk idastambuk requested a review from a team as a code owner January 8, 2024 19:06
@idastambuk idastambuk merged commit 740ee8b into main Jan 10, 2024
4 checks passed
@idastambuk idastambuk deleted the timestamp branch January 10, 2024 09:37
@idastambuk idastambuk mentioned this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom component showing duplicate records when streaming is enabled for the panel
3 participants