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: crash when spend limit not set #651

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

jim380
Copy link
Contributor

@jim380 jim380 commented Jan 16, 2025

Problem

The application was crashing with the error:

TypeError: Cannot read properties of undefined (reading 'denom')

This occurred when a feegrant was created without a spend limit using the command provider-services tx feegrant grant main X --expiration "Y".

Solution

Added null checks and fallback UI for undefined spend limits in authorization components:

  • Added optional chaining for spend_limit access in AllowanceGrantedRow
  • Added optional chaining for spend_limit access in AllowanceIssuedRow
  • Added optional chaining for spend_limit access in GranteeRow
  • Added "Unlimited" display text when no spend limit exists

Testing

  • Verified handling of feegrants with no spend limit
  • Confirmed display of "Unlimited" text for unlimited grants
  • Tested both limited and unlimited feegrant scenarios

Related Issues

Closes #609

@jim380 jim380 requested a review from a team as a code owner January 16, 2025 10:08
Copy link
Contributor

@baktun14 baktun14 left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks for your contribution!

@baktun14 baktun14 merged commit 0280e58 into akash-network:main Jan 20, 2025
5 checks passed
@jim380
Copy link
Contributor Author

jim380 commented Jan 20, 2025

Makes sense, thanks for your contribution!

I'm looking to contribute more. Is there a community I can join? I'm already in the Discord.

@brewsterdrinkwater
Copy link

Thanks for the contribution. It would be great if you could introduce yourself in sig-client channel, or if you could join a future sig call. Feel free to continue using the product, and share any feedback or any issues in the console repo, or elsewhere.

Here is the calendar: https://akash.network/development/welcome/

Akash Roadmap: https://akash.network/roadmap/2025/

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.

Crash on /settings/authorizations
3 participants