Skip to content

fix(keys): use Promise.allSettled to handle corrupted keypair files - #36

Open
NathanOyewole wants to merge 2 commits into
jup-ag:mainfrom
NathanOyewole:fix/keys-promise-allsettled
Open

NathanOyewole wants to merge 2 commits into
jup-ag:mainfrom
NathanOyewole:fix/keys-promise-allsettled

Conversation

@NathanOyewole

Copy link
Copy Markdown

Summary

Fixes #23. The keys list command used Promise.all() to load all keypairs in parallel. If any single keypair file was corrupted or unreadable, the entire Promise.all() rejected and the command failed, preventing users from seeing their valid keys.

Fix

  • Replaced Promise.all() with Promise.allSettled().
  • Valid keys are collected and displayed normally.
  • Failed keypairs log a warning with the error reason instead of crashing.
  • Command completes successfully even with corrupted files.

Test plan

  • Place a corrupted JSON file in the keys directory, run jup keys list — verify valid keys are displayed and a warning is logged for the corrupted file.
  • Verify existing tests pass.

Instead of silently skipping tokens with missing metadata, log a warning
and display the token with available on-chain information (mint address,
raw balance). This prevents incomplete portfolio displays without user
awareness.

Fixes jup-ag#24
Replace Promise.all() with Promise.allSettled() so that a single
corrupted or unreadable keypair file no longer crashes the entire
keys list command. Valid keys are still displayed, and a warning
is logged for any that failed to load.

Fixes jup-ag#23
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.

keys list crashes if any keypair file is corrupted

1 participant