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: use total_count CTE and return it with the parsed results #2073

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

tippenein
Copy link
Collaborator

@tippenein tippenein commented Sep 6, 2024

the count column was previously counting the total of results returned, rather than results in the total set. This will compute the total separately from the offset and limit params

@tippenein tippenein marked this pull request as draft September 6, 2024 22:04
Copy link

github-actions bot commented Sep 6, 2024

Vercel deployment URL: https://stacks-blockchain-7037vi43c-hirosystems.vercel.app 🚀

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@tippenein tippenein marked this pull request as ready for review September 9, 2024 15:19
src/datastore/common.ts Outdated Show resolved Hide resolved
src/datastore/helpers.ts Outdated Show resolved Hide resolved
src/datastore/pg-store-v2.ts Outdated Show resolved Hide resolved
Comment on lines +525 to +526
INNER JOIN txs USING (tx_id, index_block_hash, microblock_hash)
WHERE canonical = TRUE AND microblock_canonical = TRUE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this join, add the WHERE canonical = TRUE AND microblock_canonical = TRUE filters to the union tables above

@tippenein tippenein force-pushed the fix-total-transactions-api-2061 branch from 06f06b6 to d13d425 Compare September 9, 2024 17:09
@tippenein tippenein merged commit bb30911 into develop Sep 9, 2024
27 checks passed
@tippenein tippenein deleted the fix-total-transactions-api-2061 branch September 9, 2024 21:57
blockstack-devops pushed a commit that referenced this pull request Oct 7, 2024
## [8.1.0-beta.1](v8.0.3...v8.1.0-beta.1) (2024-10-07)

### Features

* add block etag ([#2103](#2103)) ([66e6800](66e6800))
* add cache handler for principal activity including mempool transactions ([#2100](#2100)) ([2370c21](2370c21))
* add principal cache etag to account endpoints ([#2097](#2097)) ([28e9864](28e9864))
* return estimated balance in account balance endpoints ([#2104](#2104)) ([e217cea](e217cea))

### Bug Fixes

* prune and restore mempool transactions with equal nonces for the same sender ([#2091](#2091)) ([1ce75de](1ce75de))
* use total_count CTE and return it with the parsed results ([#2073](#2073)) ([bb30911](bb30911))
@blockstack-devops
Copy link

🎉 This PR is included in version 8.1.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

blockstack-devops pushed a commit that referenced this pull request Oct 16, 2024
## [8.1.0](v8.0.4...v8.1.0) (2024-10-16)

### Features

* add block etag ([#2103](#2103)) ([66e6800](66e6800))
* add cache handler for principal activity including mempool transactions ([#2100](#2100)) ([2370c21](2370c21))
* add principal cache etag to account endpoints ([#2097](#2097)) ([28e9864](28e9864))
* return estimated balance in account balance endpoints ([#2104](#2104)) ([e217cea](e217cea))

### Bug Fixes

* add declaration copy step in build ([#2110](#2110)) ([2b6aa6a](2b6aa6a))
* prune and restore mempool transactions with equal nonces for the same sender ([#2091](#2091)) ([1ce75de](1ce75de))
* randomize key order for testnet stx faucet transactions ([#2120](#2120)) ([f7265f9](f7265f9))
* update mempool garbage collection logic for 3.0 ([#2117](#2117)) ([8b10b69](8b10b69))
* use total_count CTE and return it with the parsed results ([#2073](#2073)) ([bb30911](bb30911))
@blockstack-devops
Copy link

🎉 This PR is included in version 8.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

total transactions reported as 0 when an offset is used
3 participants