Skip to content

fix(storage): ensure monotonic ID ordering for sql query history list and batch prune - #629

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
fix/sql-history-order-batch-prune
Aug 26, 2026
Merged

fix(storage): ensure monotonic ID ordering for sql query history list and batch prune#629
ZhuchkaTriplesix merged 1 commit into
devfrom
fix/sql-history-order-batch-prune

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Fixes non-deterministic history ordering in high-speed batch loops on CI runners caused by microsecond precision formatting in ISO8601 strings and virtual clock jitter.

Changes

  1. LocalDb (lib/core/storage/local_db.dart):
    • Changed listSqlQueryHistory to sort by monotonic primary key ORDER BY id DESC.
    • Changed _pruneSqlQueryHistoryBucket to prune oldest records by monotonic primary key ORDER BY id ASC.
    • Cleaned up in-memory _historyInsertCounts on clearSqlQueryHistoryForConnection, clearSqlQueryHistoryBucket, and removeConnection.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 8ada5e7 into dev Aug 26, 2026
4 checks passed
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