WIP: Fix kassenbuch get_buchungen for microseconds - #143
Open
mgmax wants to merge 2 commits into
Open
Conversation
This commit just exposes the error and clarifies the type usage travis will fail, so skip CI: [CI skip]
From now on, kassenbuch discards all microseconds when filtering for a specific time range. This may create a race-condition if a booking is made at xxx.100 seconds and then `kassenbuch show` is called at xxx.200 sec, because the booking was made after xxx.000 sec and the `snapshot_time` mechanism filters out the booking from the "future".
Current coverage is 28.33% (diff: 95.83%)
@@ development #143 diff @@
=============================================
Files 54 54
Lines 6774 6789 +15
Methods 0 0
Messages 0 0
Branches 0 0
=============================================
+ Hits 1910 1924 +14
- Misses 4864 4865 +1
Partials 0 0
|
mgmax
marked this pull request as draft
December 26, 2022 15:54
dh4nav
approved these changes
Jun 14, 2023
dh4nav
left a comment
There was a problem hiding this comment.
Schaut gut aus, hab keine Probleme gefunden.
dh4nav
marked this pull request as ready for review
June 14, 2023 14:02
dh4nav
self-requested a review
June 14, 2023 15:07
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.
Using
Datetime()in the SQLite query strips away the microseconds. SQLites cannot do datetime formatting for microseconds, even withstrftime().First workaround:
Discards all microseconds when filtering for a specific time range.
Problem:
This may create a race-condition if a booking is made at xxx.100 seconds and then
kassenbuch showis called at xxx.200 sec, because the booking was made after xxx.000 secand the
snapshot_timemechanism filters out the booking from the "future".