Repository navigation
Conversation
… so it plays well with its database uniqueness constraint Signed-off-by: Nicolas Höning <[email protected]>
Documentation build overview
|
This branch has not been deployed
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.
Description
Posting an annotation with a changed end time can return HTTP 500. The lookup includes end and omits belief_time, while the database uniqueness constraint includes belief_time and excludes end. Extending an existing EV label from 07:00 to 07:15 therefore attempts a conflicting insert.
Align the lookup with the database identity: content, start, belief time, source and type. When an annotation already exists, update its end time and reuse it. Preserve separate annotations for different belief times.
Regression tests cover extending an annotation, repeating the request and preserving distinct belief times. The failure and fix were also reproduced locally using v1.1.1’s annotation model on an isolated SQLite database; the full server test suite has not been run.
Found while working on the HEMS script, as I made annotations longer.
documentation/changelog.rst