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(ui): catch and handle 'stakers' box value 404 errors [reverted] #165

Merged
merged 1 commit into from
May 22, 2024

Conversation

drichar
Copy link
Collaborator

@drichar drichar commented May 22, 2024

When calling fetchStakedInfoForPool for a staking pool with no stakers (yet), attempting to fetch that pool contract's 'stakers' box value will return a 404 error. An error message is shown by StakingDetails.

Now we catch the error from getBoxValue('stakers') and if it's a 404, return an empty StakedInfo array.

⚠️ This change is reverted by #167

When calling fetchStakedInfoForPool for a staking pool with no stakers (yet), attempting to fetch that pool contract's 'stakers' box value will return a 404 error. An error message is shown by StakingDetails.

Now we catch the error from getBoxValue('stakers') and if it's a 404, return an empty array.
Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
reti ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:34pm

@drichar drichar merged commit 8cdafb1 into dev May 22, 2024
3 checks passed
@drichar drichar deleted the fix/ui-handle-stakers-box-value-404 branch May 22, 2024 19:36
drichar added a commit that referenced this pull request May 22, 2024
drichar added a commit that referenced this pull request May 22, 2024
* Revert "fix(ui): catch and handle 'stakers' box value 404 errors (#165)"

This reverts commit 8cdafb1.

* fix(ui): wait until step 2 to invalidate 'pools-info' query

In the add pool workflow, the 'pools-info' query was being invalidated after step 1 when the pool is still in the "limbo" state before the storage MBR is paid. That's why fetchStakedInfoForPool was throwing a 404 error: the 'stakers' box value has not been set yet.

This moves invalidation to step 2, after the box value has been set. No more error.
@drichar drichar changed the title fix(ui): catch and handle 'stakers' box value 404 errors fix(ui): catch and handle 'stakers' box value 404 errors [reverted] May 22, 2024
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.

1 participant