Skip to content

serverdb: Fix false commit conflict on datetimes#454

Merged
kofrezo merged 2 commits into
mainfrom
dk_fix_timing_bug
Jul 1, 2026
Merged

serverdb: Fix false commit conflict on datetimes#454
kofrezo merged 2 commits into
mainfrom
dk_fix_timing_bug

Conversation

@kofrezo

@kofrezo kofrezo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

_validate_commit compared the current value via json_encode_extra()
against the old value via str(). For datetime attributes these never
match, since str() keeps microseconds and the "+00:00" tz form while
json_encode_extra() drops both.

kofrezo added 2 commits July 1, 2026 15:57
_validate_commit compared the current value via json_encode_extra()
against the old value via str(). For datetime attributes these never
match, since str() keeps microseconds and the "+00:00" tz form while
json_encode_extra() drops both.
@kofrezo kofrezo self-assigned this Jul 1, 2026
@kofrezo kofrezo added the bug label Jul 1, 2026
@kofrezo kofrezo requested a review from seqizz July 1, 2026 14:01
@kofrezo

kofrezo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

This should fix bugs such as:

serveradmin.serverdb.query_committer.CommitNewerData: ["Newer data available for attribute [(9, 'last_updated', datetime.datetime(2026, 7, 1, 13, 25, 31, 987683, tzinfo=datetime.timezone.utc))]"]

@seqizz seqizz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand this will solve most (maybe all) errors we're getting for backup backend at least, since we pass datetime object, now being normalized. If I still keep seeing issues, I can dig a bit more, maybe I am doing something extra wrong (while passing both backup_state and backup_datetime attrs in same commit).

@kofrezo kofrezo merged commit b8ccf3d into main Jul 1, 2026
5 checks passed
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.

2 participants