-
Notifications
You must be signed in to change notification settings - Fork 3
53000 - gracefully manage ChartIQView destruction #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e-SDK into users/chirag.vora/53000-rn-crash
| import { StyleSheet, View, ViewStyle } from 'react-native'; | ||
| import { ChartIQ, ChartIQLanguages, ChartIQView } from 'react-native-chartiq'; | ||
| import { SafeAreaView } from 'react-native-safe-area-context'; | ||
| import { useNavigation, useRoute } from '@react-navigation/native'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This linter warning are starting to pile up, should we knock out these simple ones that suggest import order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| const RootNavigator: React.FC = () => { | ||
| // Flag to start app in Test Rig screen | ||
| const shouldStartInTestRig = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ahead and set this back to false, just in case we forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops! Thanks for catching. I've mentioned it's false by default in PR description but missed to stage.
jdrichards50
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, testrig also very helpful.
Resolves https://chartiq.kanbanize.com/ctrl_board/15/cards/53000/details/
RCA: App was crashing when users navigated away from the chart. The chart view got destroyed but async callbacks kept running with invalid references.
Solution: Added safety checks so callbacks gracefully handle destroyed views instead of crashing. Applied the fix to both iOS (where the issue was happening) and Android (as prevention).
Testing: Added a Test Rig screen with a
shouldStartInTestRigflag in root navigator (example/src/navigation/root.navigator.tsx). When set to true(defaults to false), app opens directly to Test Rig instead of main chart, making it easy to test navigation scenarios and validate the crash fix. You will see back button only if you are navigating from test-rig screen