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: add tests and log when there is an error when persisting anchors #1202

Merged
merged 2 commits into from
May 7, 2024

Conversation

stephhuynh18
Copy link
Contributor

i forgot the test when creating the fix (#1201)

Copy link
Contributor

@stbrody stbrody left a comment

Choose a reason for hiding this comment

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

lgtm

const ipfsProofCid = await ipfsService.storeRecord({})
const anchors = await anchorService._createAnchorCommits(ipfsProofCid, merkleTree)

await Promise.all([
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we're relying on a race condition here to sometimes trigger the serialization error we are catching and retrying on? I would prefer if we inject the failure explicitly so it's deterministic, but also don't feel super strongly. Can we at least add a comment explaining what we're doing here and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made the test more deterministic and added comments

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.89%. Comparing base (9a665f0) to head (12e247f).
Report is 1 commits behind head on develop.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1202      +/-   ##
===========================================
+ Coverage    80.61%   80.89%   +0.28%     
===========================================
  Files           47       47              
  Lines         1836     1837       +1     
  Branches       309      293      -16     
===========================================
+ Hits          1480     1486       +6     
+ Misses         356      351       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stephhuynh18 stephhuynh18 merged commit c3cf4c9 into develop May 7, 2024
6 checks passed
@stephhuynh18 stephhuynh18 deleted the add-log-to-persisting-anchors-error branch May 7, 2024 20:26
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.

3 participants