Fix ResourceItem set (UTC) timestamps from string#8213
Merged
Conversation
This is mainly called when loading items from database. The previous implementation didn't handle non UTC timestamps well. Causing items like `attr/lastannounced` to be null. Instead of QDateTime the PR uses the U_TimeFromISO8601() function of the library which parses all formats. For some items have missing Z in their UTC timestamp. We can't change the database format for these to stay backward compatible, but append the Z for parsing correctly.
manup
added a commit
to manup/deconz-rest-plugin
that referenced
this pull request
May 5, 2025
PR dresden-elektronik#8213 already fixes many instances when the problem occurs, but there are valid timestamps for DDF devices in 'resource_items' table. However that's not always the case. to cleanup old invalid null entries. This PR takes the device creation time as initial value.
manup
added a commit
that referenced
this pull request
May 6, 2025
PR #8213 already fixes many instances when the problem occurs, but there are valid timestamps for DDF devices in 'resource_items' table. However that's not always the case. to cleanup old invalid null entries. This PR takes the device creation time as initial value.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is mainly called when loading items from database. The previous implementation didn't handle non UTC timestamps well. Causing items like
attr/lastannouncedto benull.Instead of
QDateTimethe PR uses theU_TimeFromISO8601()function of the library which parses all formats. Some items have missing Z in their UTC timestamp for historical reasons. We can't change the database format for these to stay backward compatible, but append the Z for parsing correctly.