fix: prevent restore crash and revert loop on node switching#468
Conversation
Add null-safety to _extractOrdersDetails() in RestoreService to handle unexpected null values from Mostro responses, matching the defensive pattern already used in _extractRestoreData(). Remove the revert-on-failure logic in MostroNodeSelector that caused a loop: when restore failed, reverting to the old (potentially offline) node triggered a second restore that also failed, leaving the user stuck with wiped data. Now the user stays on the new node and sees an error.
WalkthroughThis PR removes the restore retry mechanism and progress overlay handling from the node selector when node switching fails, and adds null-safety guards to the restore manager's order extraction logic to prevent runtime errors on malformed Mostro messages. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
Add null-safety to _extractOrdersDetails() in RestoreService to handle unexpected null values from Mostro responses, matching the defensive pattern already used in _extractRestoreData().
Remove the revert-on-failure logic in MostroNodeSelector that caused a loop: when restore failed, reverting to the old (potentially offline) node triggered a second restore that also failed, leaving the user stuck with wiped data. Now the user stays on the new node and sees an error.
Summary by CodeRabbit