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 paging address with selected fields #601

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Oct 3, 2022

Description

Fix a bug when requesting a chain to the DB with selected fields.
DB return transaction chain paginated by size of 10, if the chain has more than 10 transactions, DB return the paging address which is the transaction address of the last transaction read.
The problem is if we request specific fields without address, the transaction read have a nil address and so the paging address returned is nil. This beahavior leads to an infinite loop in some case.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Create a transaction chain with more than 10 transactions, request the chain with some specific fields without address (TransactionChain.get(address, [data: [:content], validation_stamp: [:timestamp]])) the return is {chain, true, paging_address}
with pagin address != nil

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neylix Neylix added bug Something isn't working DB Involve database labels Oct 3, 2022
@Neylix Neylix changed the base branch from master to develop October 4, 2022 08:00
@Neylix Neylix force-pushed the Fix-chain-reader-paging-address branch from 3d6d988 to fc469de Compare October 4, 2022 09:22
@Neylix Neylix force-pushed the Fix-chain-reader-paging-address branch from fc469de to 2a5b3c6 Compare October 4, 2022 09:55
@samuelmanzanera samuelmanzanera merged commit f79e293 into archethic-foundation:develop Oct 4, 2022
@Neylix Neylix deleted the Fix-chain-reader-paging-address branch October 4, 2022 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DB Involve database
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants