Skip to content

fix(mobile): guard against null certificate entries causing crash#4473

Merged
stackchain merged 4 commits intodevelopfrom
fix/null-certificate-kind-crash
Mar 3, 2026
Merged

fix(mobile): guard against null certificate entries causing crash#4473
stackchain merged 4 commits intodevelopfrom
fix/null-certificate-kind-crash

Conversation

@jorbuedo
Copy link
Contributor

@jorbuedo jorbuedo commented Mar 2, 2026

Summary

  • Fixes unhandled cannot read property 'kind' of null crash when viewing transaction history
  • After failed storage migrations (introduced in 7.0.3 hardening), the transaction cache can contain corrupted certificate arrays with null entries
  • Adds null guards at 4 consumer sites (transactionSummary.ts, operationDisplay.ts, getOperationTypeKey.ts, useFormattedTxFromWalletTransaction.tsx)
  • Also filters null certificates at the storage deserialization layer in transactionManager.ts to prevent the issue at the source

Test plan

  • Open app with a wallet that has staking/governance transactions in history
  • Verify transaction list renders without crash
  • Verify transaction details screen renders certificates correctly
  • Simulate corrupted storage by manually inserting a null entry in a transaction's certificates array in MMKV, verify no crash

🤖 Generated with Claude Code


Note

Low Risk
Defensive filtering/guards around corrupted cached transaction data; behavior change is limited to ignoring null certificate entries and bumping app/package versions.

Overview
Prevents crashes when rendering transaction history/details by filtering out null entries in transaction certificates both at persistence boundaries (parseTx in transactionManager.ts) and at key UI/logic consumers (formatted tx hook, operation display/type key, and MIR reward summary).

Also bumps the mobile app/package version from 7.0.3 to 7.0.4 (including lockfiles) for the release.

Written by Cursor Bugbot for commit 1fe41c3. This will update automatically on new commits. Configure here.

…rray

After failed storage migrations, certificate arrays can contain null
entries from corrupted/partial transaction cache data. This causes
"cannot read property 'kind' of null" crashes when viewing transactions.
jorbuedo added 2 commits March 3, 2026 12:28
Move the null filter from certificateKinds mapping to the certificates
array initialization so that all downstream length checks also exclude
null entries, preventing misclassification of corrupted certificate
transactions.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.98%. Comparing base (e9e7e9e) to head (1fe41c3).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #4473   +/-   ##
========================================
  Coverage    21.97%   21.98%           
========================================
  Files         1412     1412           
  Lines        36183    36189    +6     
  Branches      8169     8170    +1     
========================================
+ Hits          7953     7955    +2     
- Misses       27626    27630    +4     
  Partials       604      604           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stackchain stackchain merged commit ca9c018 into develop Mar 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants