Skip to content

Fix ResourceItem set (UTC) timestamps from string#8213

Merged
manup merged 1 commit into
dresden-elektronik:masterfrom
manup:master
May 5, 2025
Merged

Fix ResourceItem set (UTC) timestamps from string#8213
manup merged 1 commit into
dresden-elektronik:masterfrom
manup:master

Conversation

@manup

@manup manup commented May 5, 2025

Copy link
Copy Markdown
Member

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. 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.

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 manup added the Fix label May 5, 2025
@manup manup added this to the v2.30.1 milestone May 5, 2025
@manup
manup merged commit cedd964 into dresden-elektronik:master May 5, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant