Fix VehicleStatus timestamp drift for invalid placeholder values#393
Closed
tosate wants to merge 4 commits intoSAIC-iSmart-API:developfrom
Closed
Fix VehicleStatus timestamp drift for invalid placeholder values#393tosate wants to merge 4 commits intoSAIC-iSmart-API:developfrom
tosate wants to merge 4 commits intoSAIC-iSmart-API:developfrom
Conversation
nanomad
added a commit
to nanomad/saic-python-mqtt-gateway
that referenced
this pull request
Mar 13, 2026
Add VehicleStatusDriftException to clearly distinguish timestamp drift errors from unexpected failures. Invalid timestamps (None, 0, and 2147483647/Y2K38 sentinel) are now rejected upfront, and drifted timestamps raise the same exception. The vehicle handler catches this exception and logs a clean error message instead of the alarming "unexpected exception" with a full stack trace. Closes SAIC-iSmart-API#410 Closes SAIC-iSmart-API#391 Closes SAIC-iSmart-API#263 Supersedes SAIC-iSmart-API#393 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
Contributor
|
Closing in favor of #427, which takes a different approach to the same problem. This PR correctly identified #427 instead rejects the entire vehicle status update when the timestamp is bogus, and introduces a dedicated Thanks for the contribution and for identifying the Y2K38 sentinel value — we incorporated that into the fix! |
nanomad
added a commit
to nanomad/saic-python-mqtt-gateway
that referenced
this pull request
Mar 13, 2026
Add VehicleStatusDriftException to clearly distinguish timestamp drift errors from unexpected failures. Invalid timestamps (None, 0, and 2147483647/Y2K38 sentinel) are now rejected upfront, and drifted timestamps raise the same exception. The vehicle handler catches this exception and logs a clean error message instead of the alarming "unexpected exception" with a full stack trace. Closes SAIC-iSmart-API#410 Closes SAIC-iSmart-API#391 Closes SAIC-iSmart-API#263 Supersedes SAIC-iSmart-API#393 Co-Authored-By: Thomas Salm <tosate@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nanomad
added a commit
that referenced
this pull request
Mar 13, 2026
Add VehicleStatusDriftException to clearly distinguish timestamp drift errors from unexpected failures. Invalid timestamps (None, 0, and 2147483647/Y2K38 sentinel) are now rejected upfront, and drifted timestamps raise the same exception. The vehicle handler catches this exception and logs a clean error message instead of the alarming "unexpected exception" with a full stack trace. Closes #410 Closes #391 Closes #263 Supersedes #393 Co-authored-by: Thomas Salm <tosate@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Fix VehicleStatus timestamp drift (#391)
Description
This pull request fixes the issue where
MqttGatewayExceptionwas occasionally raised when the API returned the invalid timestamp2147483647.datetime.Fixes