Skip to content

feat(wallet): fix Verify Recovery Phrase crash from removed shuffledArray#846

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/seed-phrase-verify-shuffle-crash
Jul 17, 2026
Merged

feat(wallet): fix Verify Recovery Phrase crash from removed shuffledArray#846
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/seed-phrase-verify-shuffle-crash

Conversation

@romchornyi

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Reported via TestFlight (9.0.0 build 9) — the app crashes the moment the user reaches the Verify Recovery Phrase screen (Backup / Show Recovery Phrase flow):

-[__NSArrayM shuffledArray]: unrecognized selector sent to instance

The seed-phrase verification step shuffled the words via -[NSArray shuffledArray], a category method formerly provided by DashSync's NSArray+Dash. That method was dropped during the DashSync teardown, so at runtime the selector no longer resolves and the app aborts. This is deterministic — it affects every user who reaches the verification step, which is exactly the "make sure you've backed up your wallet" flow called out in the beta release notes.

What was done?

Shuffle in-place with GameplayKit's GKRandomSource instead — the header already imports GameplayKit (which the old category wrapped), so this drops the last dependency on the removed category with no behavior change.

DWSeedPhraseModel.m:68

- _words = [words shuffledArray];
+ _words = [[GKRandomSource sharedRandom] arrayByShufflingObjectsInArray:words];

This was the only remaining call site of shuffledArray in the codebase.

How Has This Been Tested?

  • Root-caused from the TestFlight crash log; call chain confirmed:
    BackupSeedPhraseViewController.actionButtonActionDWVerifySeedPhraseViewController controllerWithSeedPhrase:DWVerifySeedPhraseModel initWithSeedPhrase:DWSeedPhraseModel initByShufflingSeedPhrase:.
  • Verified shuffledArray is not defined anywhere reachable (removed from NSArray+Dash), and this is its only caller.
  • Manual smoke pending on device/testnet via Backup → Verify Recovery Phrase (word re-ordering step). Change is a 1-line drop-in using an already-imported API.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

…rray

The seed-phrase verification step shuffled the words via
-[NSArray shuffledArray], a category method formerly provided by
DashSync's NSArray+Dash. That method was dropped during the DashSync
teardown, so at runtime the selector no longer resolves and the app
aborts with "-[__NSArrayM shuffledArray]: unrecognized selector" the
moment the user reaches the Verify Recovery Phrase screen
(Backup / Show Recovery Phrase flow).

Shuffle in-place with GameplayKit's GKRandomSource instead — the header
already imports GameplayKit (which the old category wrapped), so this
drops the last dependency on the removed category with no behavior
change.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 594ff7a7-34bf-4be6-acea-fc9a7d818a7f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/seed-phrase-verify-shuffle-crash

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer
QuantumExplorer merged commit 914aa32 into swift-sdk-integration Jul 17, 2026
2 checks passed
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.

3 participants