Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: transaction sorting now takes time of day and creation time into account #834

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

morremeyer
Copy link
Member

Before this fix, transactions would be sorted correctly by date, but
transactions later in a day would be after transactions earlier in the day.

When transactions were added for the exact same time (typically when importing),
sorting was undefined. Sorting for transactions at the same time now is "newest first"
by creation time, putting transactions added later earlier in the list.

Since the sorting is "newest first", this was wrong.

Sorting takes place with second precision, meaning that any sub-second differences
are ignored in sorting. This is a limitation of the sqlite datetime function.

… account

Before this fix, transactions would be sorted correctly by date, but
transactions later in a day would be after transactions earlier in the day.

When transactions were added for the exact same time (typically when importing),
sorting was undefined. Sorting for transactions at the same time now is "newest first"
by creation time, putting transactions added later earlier in the list.

Since the sorting is "newest first", this was wrong.

Sorting takes place with second precision, meaning that any sub-second differences
are ignored in sorting. This is a limitation of the sqlite `datetime` function.
@morremeyer morremeyer requested a review from a team as a code owner November 11, 2023 15:59
@morremeyer morremeyer enabled auto-merge (squash) November 11, 2023 16:00
Copy link

codecov bot commented Nov 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ec988ff) 81.11% compared to head (452f6fa) 81.11%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #834   +/-   ##
=======================================
  Coverage   81.11%   81.11%           
=======================================
  Files          41       41           
  Lines        4029     4029           
=======================================
  Hits         3268     3268           
  Misses        627      627           
  Partials      134      134           
Files Coverage Δ
pkg/controllers/transaction_v1.go 92.50% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@morremeyer morremeyer merged commit bb8d6db into main Nov 11, 2023
6 checks passed
@morremeyer morremeyer deleted the fix/transaction-sorting branch November 11, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant