Repository navigation
fix: arweave truncation, GraphQL pagination, versioning in spec, reconciliation re-fetch - #773
Merged
Conversation
…nciliation re-fetch - trustflow-protocol#756: ArweaveArchiveService now actually truncates oversized dispute archives instead of only logging a warning; falls back to a minimal stub if still too large - trustflow-protocol#763: GraphQL escrows query now accepts offset/limit args and returns EscrowPage (data, total, offset, limit) matching the REST list pagination contract - trustflow-protocol#758: Supertest integration tests enable URI versioning on the Nest app so /v1/reputation/* routes resolve instead of 404ing - trustflow-protocol#750: EscrowReconciliationService fetches the full escrow list once and filters in-memory, eliminating the O(n) re-fetch loop that called findAll on every batch
|
@0xpreshh 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! 🚀 |
…rsioning-reconciliation
5 of 7 tasks
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.
Summary
This PR fixes four bugs across the dispute, escrow GraphQL, reputation, and reconciliation modules.
#756 — ArweaveArchiveService logs truncation but never truncates
The service logged a warning when the archive exceeded 256 KB but passed the full unmodified JSON to the uploader anyway. Now, when the size limit is exceeded,
votesis sliced to 10 entries andstepHistoryto 20. If the payload is still oversized after that, a minimal stub with only the essential saga identifiers is uploaded and_truncated: trueis set so the record is clearly marked incomplete.#763 — GraphQL
escrowsquery has no paginationThe
escrowsquery returned a flat[EscrowType]array with no way to page through results, unlike every REST list endpoint in the same module. It now acceptsoffset(default 0) andlimit(default 20, max 100) args and returns anEscrowPageobject{ data, total, offset, limit }— matching the same shape the REST/escrowsendpoints use. Integration spec updated accordingly.#758 — Supertest integration tests always 404 due to missing versioning
The Supertest integration suite in
reputation.controller.spec.tstested against/v1/reputation/*routes but never calledapp.enableVersioning(), so the version prefix was never registered and every request 404'd. Addedapp.enableVersioning({ type: VersioningType.URI, defaultVersion: '1' })beforeapp.init()to mirror whatconfigureAppdoes in production.#750 — EscrowReconciliationService re-fetches full escrow list on every batch
The cursor-based pagination loop called
this.escrowService.findAll()on every iteration, fetching the entire escrow table repeatedly and slicing with an in-memory offset — O(n²) in the number of batches. Replaced with a singlefindAll()call followed by an in-memoryfilter, which is the correct approach givenfindAllalready returns the full dataset.Closes #756
Closes #763
Closes #758
Closes #750