Improve Horizon listener reconciliation: transactional invariants and recovery - #1602
Open
DevALVIN-24 wants to merge 1 commit into
Open
DevALVIN-24 wants to merge 1 commit into
DevALVIN-24 wants to merge 1 commit into
Conversation
…ry pagination in TransactionRepository
|
@DevALVIN-24 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
closes #1551
Description
Refs #Quality (Improve Horizon listener reconciliation)
This PR addresses the transactional invariants, query correctness, and pagination boundaries for the Horizon listener reconciliation engine and
TransactionRepository.Proposed Changes
src/repositories/transactionRepository.tslistWithCursorandlistByVaultmethods to build and chain Knex filters first before applying final ordering (orderBy) and limits (limit)..whereafter.limitresulted in calling methods on completed promises/resolved arrays (especially under mock and specific query builder environments), making database operations fully deterministic.src/repositories/transactionRepository.test.tscreateto include required fields (vault_id,type) matching constraints enforced byvalidateTransactionInputto satisfy strict data invariants.Verification Results
All tests pass successfully:
npm run test src/tests/horizonListener.chaos.test.ts(17/17 tests passing)npm run test src/tests/horizonListener.test.ts(9/9 tests passing)npm run test src/services/horizonReconciliation.boundary.test.ts(19/19 tests passing)npm run test src/services/horizonReconciliation.test.ts(10/10 tests passing)npm run test src/repositories/transactionRepository.test.ts(10/10 tests passing)Unavoidable Limitations / Pre-existing CI Failures
There are pre-existing issues in other unrelated test suites (e.g.
src/tests/adminVerifiers.test.tsdue to duplicate identifier declaration, and dependency errors in oauth & auth routes). These issues pre-exist in the codebase and are out of scope for this feature branch.