Skip to content

Fix child account#900

Merged
jaymengxy merged 2 commits intodevelopfrom
fix_child_account
Apr 30, 2025
Merged

Fix child account#900
jaymengxy merged 2 commits intodevelopfrom
fix_child_account

Conversation

@jaymengxy
Copy link
Copy Markdown
Contributor

Related Issue

Closes #880 #493

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@jaymengxy jaymengxy added this to the [HotFix] Release 2.8.4 milestone Apr 29, 2025
@jaymengxy jaymengxy self-assigned this Apr 29, 2025
@jaymengxy jaymengxy requested a review from a team as a code owner April 29, 2025 23:47
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2025

PR Summary

Fixed multiple issues related to child account management and arithmetic operations. Improved child account caching by replacing custom cache class with ArrayList, added null safety checks in NFT movement dialog, and prevented division by zero in amount conversion. Also bumped app version to r2.8.4.

Changes

File Summary
app/src/main/java/com/flowfoundation/wallet/manager/childaccount/ChildAccountList.kt Replaced custom ChildAccountCache class with direct ArrayList usage. Modified cache manager to handle List<ChildAccount> instead of custom cache class, improving type safety and reducing code complexity.
app/src/main/java/com/flowfoundation/wallet/page/nft/move/MoveNFTDialog.kt Enhanced null safety in NFT movement dialog by adding proper null checks when handling child accounts and address lists, preventing potential null pointer exceptions.
app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/presenter/SendAmountPresenter.kt Added check to prevent division by zero when converting amounts with zero rate, returning BigDecimal.ZERO instead of throwing arithmetic exception.
gradle.properties Bumped version code from 271 to 275 and version name from r2.8.3 to r2.8.4.

autogenerated by presubmit.ai

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🚨 Pull request needs attention.

Review Summary

Commits Considered (2)
  • 8911334: fix: arithmetic exception
  • 374c4d0: fix: child accout cache issue
Files Processed (4)
  • app/src/main/java/com/flowfoundation/wallet/manager/childaccount/ChildAccountList.kt (4 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/nft/move/MoveNFTDialog.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/presenter/SendAmountPresenter.kt (1 hunk)
  • gradle.properties (1 hunk)
Actionable Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/page/nft/move/MoveNFTDialog.kt [126-130]

    possible bug: "Potential null pointer exception in list access"

  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/presenter/SendAmountPresenter.kt [261-263]

    possible issue: "Potential division by zero error"

Skipped Comments (0)

@jaymengxy jaymengxy merged commit 16d017a into develop Apr 30, 2025
3 checks passed
@jaymengxy jaymengxy deleted the fix_child_account branch April 30, 2025 03:46
@github-actions github-actions Bot mentioned this pull request May 13, 2025
5 tasks
lealobanov added a commit that referenced this pull request Dec 17, 2025
Restore the Android native implementations for recovery/restore screen entry points that were lost during the refactoring from monolithic NativeFRWBridge to handler-based architecture.

## Changes

### NativeScreen.kt
- Add missing restore screen enum values:
  - RECOVERY_PHRASE_RESTORE
  - KEY_STORE_RESTORE
  - PRIVATE_KEY_RESTORE
  - GOOGLE_DRIVE_RESTORE
  - ICLOUD_RESTORE
  - MULTI_RESTORE

### UIBridgeHandler.kt
- Add imports for restore activities
- Add handlers for all 6 restore screen types
- Map each screen to appropriate Android Activity:
  - RECOVERY_PHRASE_RESTORE → RestoreMnemonicActivity
  - KEY_STORE_RESTORE → KeyStoreRestoreActivity (key store mode)
  - PRIVATE_KEY_RESTORE → KeyStoreRestoreActivity (private key mode)
  - GOOGLE_DRIVE_RESTORE → MultiRestoreActivity
  - ICLOUD_RESTORE → MultiRestoreActivity (Android fallback)
  - MULTI_RESTORE → MultiRestoreActivity

## Context

These implementations existed in commit ec2fb17 but were lost during the architectural refactoring to handler-based pattern (commit cbb91ac). This fix restores the functionality in the new architecture.

Closes #900
lealobanov added a commit that referenced this pull request Dec 17, 2025
Restore the Android native implementations for recovery/restore screen entry points that were lost during the refactoring from monolithic NativeFRWBridge to handler-based architecture.

## Changes

### NativeScreen.kt
- Add missing restore screen enum values:
  - RECOVERY_PHRASE_RESTORE
  - KEY_STORE_RESTORE
  - PRIVATE_KEY_RESTORE
  - GOOGLE_DRIVE_RESTORE
  - ICLOUD_RESTORE
  - MULTI_RESTORE

### UIBridgeHandler.kt
- Add imports for restore activities
- Add handlers for all 6 restore screen types
- Map each screen to appropriate Android Activity:
  - RECOVERY_PHRASE_RESTORE → RestoreMnemonicActivity
  - KEY_STORE_RESTORE → KeyStoreRestoreActivity (key store mode)
  - PRIVATE_KEY_RESTORE → KeyStoreRestoreActivity (private key mode)
  - GOOGLE_DRIVE_RESTORE → MultiRestoreActivity
  - ICLOUD_RESTORE → MultiRestoreActivity (Android fallback)
  - MULTI_RESTORE → MultiRestoreActivity

## Context

These implementations existed in commit ec2fb17 but were lost during the architectural refactoring to handler-based pattern (commit cbb91ac). This fix restores the functionality in the new architecture.

Closes #900
lealobanov added a commit that referenced this pull request Dec 17, 2025
* fix(android): re-implement missing native recovery screen entry points

Restore the Android native implementations for recovery/restore screen entry points that were lost during the refactoring from monolithic NativeFRWBridge to handler-based architecture.

## Changes

### NativeScreen.kt
- Add missing restore screen enum values:
  - RECOVERY_PHRASE_RESTORE
  - KEY_STORE_RESTORE
  - PRIVATE_KEY_RESTORE
  - GOOGLE_DRIVE_RESTORE
  - ICLOUD_RESTORE
  - MULTI_RESTORE

### UIBridgeHandler.kt
- Add imports for restore activities
- Add handlers for all 6 restore screen types
- Map each screen to appropriate Android Activity:
  - RECOVERY_PHRASE_RESTORE → RestoreMnemonicActivity
  - KEY_STORE_RESTORE → KeyStoreRestoreActivity (key store mode)
  - PRIVATE_KEY_RESTORE → KeyStoreRestoreActivity (private key mode)
  - GOOGLE_DRIVE_RESTORE → MultiRestoreActivity
  - ICLOUD_RESTORE → MultiRestoreActivity (Android fallback)
  - MULTI_RESTORE → MultiRestoreActivity

## Context

These implementations existed in commit ec2fb17 but were lost during the architectural refactoring to handler-based pattern (commit cbb91ac). This fix restores the functionality in the new architecture.

Closes #900

* fix(android): re-implement missing native recovery screen entry points

Restore the Android native implementations for recovery/restore screen entry points that were lost during the refactoring from monolithic NativeFRWBridge to handler-based architecture.

## Changes

### NativeScreen.kt
- Add missing restore screen enum values:
  - RECOVERY_PHRASE_RESTORE
  - KEY_STORE_RESTORE
  - PRIVATE_KEY_RESTORE
  - GOOGLE_DRIVE_RESTORE
  - ICLOUD_RESTORE
  - MULTI_RESTORE

### UIBridgeHandler.kt
- Add imports for restore activities
- Add handlers for all 6 restore screen types
- Map each screen to appropriate Android Activity:
  - RECOVERY_PHRASE_RESTORE → RestoreMnemonicActivity
  - KEY_STORE_RESTORE → KeyStoreRestoreActivity (key store mode)
  - PRIVATE_KEY_RESTORE → KeyStoreRestoreActivity (private key mode)
  - GOOGLE_DRIVE_RESTORE → MultiRestoreActivity
  - ICLOUD_RESTORE → MultiRestoreActivity (Android fallback)
  - MULTI_RESTORE → MultiRestoreActivity

## Context

These implementations existed in commit ec2fb17 but were lost during the architectural refactoring to handler-based pattern (commit cbb91ac). This fix restores the functionality in the new architecture.

Closes #900

* refactor(android): remove ICLOUD_RESTORE handler (iOS-only feature)

Remove ICLOUD_RESTORE from Android native code since:
- iCloud button is only shown on iOS (Platform.OS === 'ios')
- Handler is unreachable on Android
- Keeps Android code clean and platform-specific

Changes:
- Remove ICLOUD_RESTORE from NativeScreen enum
- Remove ICLOUD_RESTORE handler from UIBridgeHandler
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.

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 (MoveNFTDialog.kt:128)

2 participants