fix: prevent parser crash on app initialization push payload#7049
fix: prevent parser crash on app initialization push payload#7049deepak0x wants to merge 1 commit intoRocketChat:developfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🔇 Additional comments (1)
WalkthroughFixes a variable shadowing bug in the restore saga where Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Fixes JSON.parse(undefined) SyntaxError in app/sagas/init.js when AsyncStorage.removeItem returns undefined. Closes RocketChat#7014
9a65708 to
4f5e32b
Compare
Proposed changes
Fixes a variable shadowing bug in
app/sagas/init.jswhere the innerpushNotificationconstant reassignment resulted in aSyntaxError: JSON.parse(undefined)crash whenAsyncStorage.removeItemreturnedundefined. This issue resulted in prematurely breaking the restore flow and occasionally looping or forcing a re-login.Fixed by not reassigning the variable during the remove action and passing the correct outer tracked notification data to the parsing callback.
Issue(s)
Fixes #7014
How to test or reproduce
SyntaxError: JSON.parse(undefined)crash no longer appears in logs natively.Screenshots
N/A
Types of changes
Checklist
Further comments
N/A
Summary by CodeRabbit
Bug Fixes