Skip to content

Conversation

@stwiname
Copy link
Contributor

@stwiname stwiname commented Nov 11, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a cache mutation issue that could cause blocks to be skipped during execution, improving system reliability and ensuring consistent behavior during cache operations

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Walkthrough

This PR releases version 4.0.6 of the Node package by promoting the pre-release version to stable, removing the stableVersion field, and documenting a cache mutation bugfix in the changelog.

Changes

Cohort / File(s) Summary
Version Release
packages/node/CHANGELOG.md, packages/node/package.json
Updated version from 4.0.6-0 (pre-release) to 4.0.6 (stable); removed stableVersion field; added release entry in CHANGELOG documenting cache mutation fix (#165)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • subquery/subql-algorand#163: Identical pattern of version promotion from pre-release to stable with stableVersion removal and parallel CHANGELOG updates

Poem

🐰 A hop, a skip, a version bump—
From four-point-oh-six-oh into the sun!
Cache bugs squashed, the release is spun,
Stable at last, our work is done!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title '[release] 20251112' is vague and generic, using a date stamp without clearly describing what changes are being released or the main purpose of the PR. Replace the generic date-based title with a descriptive summary of the main change, such as '[release] Bump node package to 4.0.6' or '[release] Fix cache mutation bug causing blocks to be skipped'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release-20251112

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c53f9a and 99f3b36.

📒 Files selected for processing (2)
  • packages/node/CHANGELOG.md (2 hunks)
  • packages/node/package.json (2 hunks)
🔇 Additional comments (4)
packages/node/package.json (1)

3-3: Version promotion to stable looks good.

Pre-release version 4.0.6-0 is correctly normalized to stable 4.0.6. According to the AI summary, the stableVersion field was also removed as part of this release; the provided code snippet doesn't show this field, which is expected for a stable release.

packages/node/CHANGELOG.md (3)

7-11: Changelog structure correctly updated for 4.0.6 stable release.

The Unreleased section is now empty (lines 7–8), and the new stable 4.0.6 entry (lines 9–11) is properly formatted with the fix and issue reference. The version progression from 4.0.5 (patch bump) is semantically correct.


327-328: Reference links correctly updated for 4.0.6 release.

The Unreleased and 4.0.6 comparison links (lines 327–328) follow the established pattern and properly reference the correct version tags.


9-9: Verify release date alignment.

The changelog date is 2025-11-12, while the PR was created 2025-11-11T22:26:07Z. Please confirm the release date is intentional (e.g., scheduled for tomorrow) or should match today's date. Also, verify this change aligns with the package.json version update from "4.0.6-0" to "4.0.6" and removal of the stableVersion field.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 33.55% 893/2662
🔴 Branches 56.39% 75/133
🔴 Functions 28.79% 38/132
🔴 Lines 33.55% 893/2662

Test suite run failed

Failed tests: 4/21. Failed suites: 3/4.
  ● dictionary v1 › successfully validates metatada

    ApolloError: Failed to parse URL from /graphql

      at new ApolloError (node_modules/@apollo/client/errors/index.js:59:28)
      at node_modules/@apollo/client/core/QueryManager.js:823:71
      at both (node_modules/@apollo/client/utilities/observables/asyncMap.js:35:31)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:24:72
      at Object.then (node_modules/@apollo/client/utilities/observables/asyncMap.js:24:24)
      at Object.error (node_modules/@apollo/client/utilities/observables/asyncMap.js:37:49)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:11:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:11:25)
      at Object.error (node_modules/@apollo/client/utilities/observables/Concast.js:76:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at handleError (node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:170:14)
      at node_modules/@apollo/client/link/http/createHttpLink.js:148:17

    Cause:
    TypeError: Failed to parse URL from /graphql



    Cause:
    TypeError: Invalid URL

      146 |       chainId,
      147 |     );
    > 148 |     await dictionary.init();
          |                      ^
      149 |     return dictionary;
      150 |   }
      151 |

      at node_modules/@apollo/client/link/http/createHttpLink.js:130:13
      at new Subscription (node_modules/zen-observable/lib/Observable.js:197:34)
      at Observable.subscribe (node_modules/zen-observable/lib/Observable.js:279:14)
      at Object.complete (node_modules/@apollo/client/utilities/observables/Concast.js:111:43)
      at Concast.Object.<anonymous>.Concast.start (node_modules/@apollo/client/utilities/observables/Concast.js:152:23)
      at new Concast (node_modules/@apollo/client/utilities/observables/Concast.js:137:19)
      at QueryManager.Object.<anonymous>.QueryManager.getObservableFromLink (node_modules/@apollo/client/core/QueryManager.js:744:37)
      at QueryManager.Object.<anonymous>.QueryManager.getResultsFromLink (node_modules/@apollo/client/core/QueryManager.js:786:30)
      at resultsFromLink (node_modules/@apollo/client/core/QueryManager.js:1114:26)
      at QueryManager.Object.<anonymous>.QueryManager.fetchQueryByPolicy (node_modules/@apollo/client/core/QueryManager.js:1177:52)
      at fromVariables (node_modules/@apollo/client/core/QueryManager.js:856:41)
      at QueryManager.Object.<anonymous>.QueryManager.fetchConcastWithInfo (node_modules/@apollo/client/core/QueryManager.js:898:35)
      at QueryManager.Object.<anonymous>.QueryManager.fetchQuery (node_modules/@apollo/client/core/QueryManager.js:383:21)
      at QueryManager.Object.<anonymous>.QueryManager.query (node_modules/@apollo/client/core/QueryManager.js:481:21)
      at ApolloClient.Object.<anonymous>.ApolloClient.query (node_modules/@apollo/client/core/ApolloClient.js:276:34)
      at AlgorandDictionaryV1.init (node_modules/@subql/node-core/src/indexer/dictionary/v1/dictionaryV1.ts:54:21)
      at AlgorandDictionaryV1.create (packages/node/src/indexer/dictionary/v1/algorandDictionaryV1.ts:148:22)
      at Object.<anonymous> (packages/node/src/indexer/dictionary/v1/algorandDictionaryV1.spec.ts:72:45)

  ● dictionary v1 › build correct dictionary entries and remove undefined fields in filter

    ApolloError: Failed to parse URL from /graphql

      at new ApolloError (node_modules/@apollo/client/errors/index.js:59:28)
      at node_modules/@apollo/client/core/QueryManager.js:823:71
      at both (node_modules/@apollo/client/utilities/observables/asyncMap.js:35:31)
      at node_modules/@apollo/client/utilities/observables/asyncMap.js:24:72
      at Object.then (node_modules/@apollo/client/utilities/observables/asyncMap.js:24:24)
      at Object.error (node_modules/@apollo/client/utilities/observables/asyncMap.js:37:49)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at node_modules/@apollo/client/utilities/observables/iteration.js:11:68
          at Array.forEach (<anonymous>)
      at iterateObserversSafely (node_modules/@apollo/client/utilities/observables/iteration.js:11:25)
      at Object.error (node_modules/@apollo/client/utilities/observables/Concast.js:76:21)
      at notifySubscription (node_modules/zen-observable/lib/Observable.js:140:18)
      at onNotify (node_modules/zen-observable/lib/Observable.js:179:3)
      at SubscriptionObserver.error (node_modules/zen-observable/lib/Observable.js:240:7)
      at handleError (node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:170:14)
      at node_modules/@apollo/client/link/http/createHttpLink.js:148:17

    Cause:
    TypeError: Failed to parse URL from /graphql



    Cause:
    TypeError: Invalid URL

      146 |       chainId,
      147 |     );
    > 148 |     await dictionary.init();
          |                      ^
      149 |     return dictionary;
      150 |   }
      151 |

      at node_modules/@apollo/client/link/http/createHttpLink.js:130:13
      at new Subscription (node_modules/zen-observable/lib/Observable.js:197:34)
      at Observable.subscribe (node_modules/zen-observable/lib/Observable.js:279:14)
      at Object.complete (node_modules/@apollo/client/utilities/observables/Concast.js:111:43)
      at Concast.Object.<anonymous>.Concast.start (node_modules/@apollo/client/utilities/observables/Concast.js:152:23)
      at new Concast (node_modules/@apollo/client/utilities/observables/Concast.js:137:19)
      at QueryManager.Object.<anonymous>.QueryManager.getObservableFromLink (node_modules/@apollo/client/core/QueryManager.js:744:37)
      at QueryManager.Object.<anonymous>.QueryManager.getResultsFromLink (node_modules/@apollo/client/core/QueryManager.js:786:30)
      at resultsFromLink (node_modules/@apollo/client/core/QueryManager.js:1114:26)
      at QueryManager.Object.<anonymous>.QueryManager.fetchQueryByPolicy (node_modules/@apollo/client/core/QueryManager.js:1177:52)
      at fromVariables (node_modules/@apollo/client/core/QueryManager.js:856:41)
      at QueryManager.Object.<anonymous>.QueryManager.fetchConcastWithInfo (node_modules/@apollo/client/core/QueryManager.js:898:35)
      at QueryManager.Object.<anonymous>.QueryManager.fetchQuery (node_modules/@apollo/client/core/QueryManager.js:383:21)
      at QueryManager.Object.<anonymous>.QueryManager.query (node_modules/@apollo/client/core/QueryManager.js:481:21)
      at ApolloClient.Object.<anonymous>.ApolloClient.query (node_modules/@apollo/client/core/ApolloClient.js:276:34)
      at AlgorandDictionaryV1.init (node_modules/@subql/node-core/src/indexer/dictionary/v1/dictionaryV1.ts:54:21)
      at AlgorandDictionaryV1.create (packages/node/src/indexer/dictionary/v1/algorandDictionaryV1.ts:148:22)
      at Object.<anonymous> (packages/node/src/indexer/dictionary/v1/algorandDictionaryV1.spec.ts:72:45)


  ● Algorand RPC › testnet data › block caching doesnt mutate the block nums

    expect(received).toEqual(expected) // deep equality

    Expected: "{\"block\":{\"bonus\":9043818,\"genesisHash\":\"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=\",\"genesisId\":\"testnet-v1.0\",\"previousBlockHash\":\"r5+mvuaiAH2R+EmMBZz64SWkhchaOm3WGcV88uI/JTs=\",\"proposer\":\"Z7EZQG64H2V5JOHERU4DYTLV2TCWAA5OF2FZ3WME56OQK2QM7DWPAR63PA\",\"rewards\":{\"feeSink\":\"A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE\",\"rewardsCalculationRound\":57500000,\"rewardsLevel\":27521,\"rewardsPool\":\"7777777777777777777777777777777777777777777777777774MSJUVU\",\"rewardsRate\":0,\"rewardsResidue\":2091697303},\"round\":57397158,\"seed\":\"qVKt2dBU/uOQZBObcVsoT7+uwwHaOIiHKNJZ3ZjNggQ=\",\"stateProofTracking\":[{\"nextRound\":57397248,\"onlineTotalWeight\":0,\"type\":0}],\"timestamp\":1762819387,\"transactions\":[],\"transactionsRoot\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"transactionsRootSha256\":\"HQn2+iMjWIFRTaDl+PeJdn5rKOch+otqMK5/Gao+puc=\",\"txnCounter\":749451947,\"upgradeState\":{\"currentProtocol\":\"https://github.com/algorandfoundation/specs/tree/953304de35264fc3ef91bcd05c123242015eeaed\",\"nextProtocolApprovals\":0,\"nextProtocolSwitchOn\":0,\"nextProtocolVoteBefore\":0},\"upgradeVote\":{\"upgradeApprove\":false,\"upgradeDelay\":0},\"hash\":\"B+mQQzLKDQB4mJvT1gOCjSfY1a+IMyZsvbOmoVCx0es=\"}}"
    Received: "{\"block\":{\"bonus\":9043818,\"genesisHash\":\"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=\",\"genesisId\":\"testnet-v1.0\",\"previousBlockHash\":\"r5+mvuaiAH2R+EmMBZz64SWkhchaOm3WGcV88uI/JTs=\",\"previousBlockHash512\":\"CEDzWyW9pRYZjmUIcykmgIql3cEtTu8QZPa17gN04y8C7zahmUCwsxM6fb5EPTqLCcf61ZCCsUQdL5bCkoMeCw==\",\"proposer\":\"Z7EZQG64H2V5JOHERU4DYTLV2TCWAA5OF2FZ3WME56OQK2QM7DWPAR63PA\",\"rewards\":{\"feeSink\":\"A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE\",\"rewardsCalculationRound\":57500000,\"rewardsLevel\":27521,\"rewardsPool\":\"7777777777777777777777777777777777777777777777777774MSJUVU\",\"rewardsRate\":0,\"rewardsResidue\":2091697303},\"round\":57397158,\"seed\":\"qVKt2dBU/uOQZBObcVsoT7+uwwHaOIiHKNJZ3ZjNggQ=\",\"stateProofTracking\":[{\"nextRound\":57397248,\"onlineTotalWeight\":0,\"type\":0}],\"timestamp\":1762819387,\"transactions\":[],\"transactionsRoot\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"transactionsRootSha256\":\"HQn2+iMjWIFRTaDl+PeJdn5rKOch+otqMK5/Gao+puc=\",\"transactionsRootSha512\":\"6pLkvdh1oF4mqCLDG6u3mSTUQWNNpCiN6idrSokhIPMraS11+/duMXXv+F0rooRAARrPTSDD6vvxRKVzecgTog==\",\"txnCounter\":749451947,\"upgradeState\":{\"currentProtocol\":\"https://github.com/algorandfoundation/specs/tree/953304de35264fc3ef91bcd05c123242015eeaed\",\"nextProtocolApprovals\":0,\"nextProtocolSwitchOn\":0,\"nextProtocolVoteBefore\":0},\"upgradeVote\":{\"upgradeApprove\":false,\"upgradeDelay\":0},\"hash\":\"B+mQQzLKDQB4mJvT1gOCjSfY1a+IMyZsvbOmoVCx0es=\"}}"

      164 |       expect(block2).toBeDefined();
      165 |
    > 166 |       expect(JSON.stringify(block1)).toEqual(JSON.stringify(block2));
          |                                      ^
      167 |     });
      168 |   });
      169 |

      at Object.<anonymous> (packages/node/src/algorand/algorand.spec.ts:166:38)


  ● ApiService › waits on pending block to fetch hash

    Unable to get block hash for round 55468035

      234 |       }
      235 |     }
    > 236 |     throw new Error(`Unable to get block hash for round ${round}`);
          |           ^
      237 |   }
      238 | }
      239 |

      at AlgorandApi.getBlockHash (packages/node/src/algorand/api.algorand.ts:236:11)
      at packages/node/src/algorand/api.algorand.ts:189:22
          at async Promise.all (index 0)
      at AlgorandApi.fetchBlocks (packages/node/src/algorand/api.algorand.ts:187:29)
      at fetchLatestBlock (packages/node/src/indexer/api.service.spec.ts:87:8)

  ● ApiService › waits on pending block to fetch hash

    Unable to get block hash for round 55468035

      234 |       }
      235 |     }
    > 236 |     throw new Error(`Unable to get block hash for round ${round}`);
          |           ^
      237 |   }
      238 | }
      239 |

      at AlgorandApi.getBlockHash (packages/node/src/algorand/api.algorand.ts:236:11)
      at packages/node/src/algorand/api.algorand.ts:189:22
          at async Promise.all (index 0)
      at AlgorandApi.fetchBlocks (packages/node/src/algorand/api.algorand.ts:187:29)
      at fetchLatestBlock (packages/node/src/indexer/api.service.spec.ts:87:8)
      at Object.<anonymous> (packages/node/src/indexer/api.service.spec.ts:91:19)

Report generated by 🧪jest coverage report action from 99f3b36

@stwiname stwiname merged commit 72a7567 into main Nov 11, 2025
3 of 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.

2 participants