Closed lachenmayer closed 2 years ago
@lachenmayer Thank you for reporting this. We're looking into it. Regarding your plan, you can reach out to us at support@instabug.com to sort this out for you.
Thanks a lot!
@lachenmayer Happy to help! Could you please share with us the full crash stack trace as well as the exact code snippet you use to start an execution trace as this crash isn't reproducible yet on our side?
Hi David, here's the full crash as exported from Instabug:
I initially thought it might be related to the fact that we perform a bunch of work before we render the initial view (we called Instabug.start
during the main componentDidMount
as mentioned in the docs), but I have changed it to just calling it when the Instabug file is imported, so as soon as possible, ie. literally:
import Instabug from 'instabug-reactnative'
Instabug.start('x', [Instabug.invocationEvent.shake])
@lachenmayer Thanks for sharing this. Would it be possible to clarify how you call the startExecutionTrace
API in your code or share with us a sample app that reproduces the issue? Appreciate your cooperation with us.
Thanks @DavidMina96, apologies for the delay. I can't share our full app code with you, but we are initializing Instabug like this:
// Instabug.ts
export function initializeInstabug() {
// See https://docs.instabug.com/docs/react-native-integration#same-build-for-beta-and-app-store
// Instabug build scripts require the token to be a constant to be able to upload source maps.
if (env.phase === 'production') {
Instabug.start('prod token', [
Instabug.invocationEvent.shake,
])
} else {
Instabug.start('staging token', [
Instabug.invocationEvent.shake,
])
}
// Explicitly enable APM.
APM.setEnabled(true)
// Make setting an email address optional.
BugReporting.setOptions([BugReporting.invocationOptions.emailFieldOptional])
}
We are calling it like this:
// main.ts
export function main() {
initializeInstabug()
const { App } = connectApp()
AppRegistry.registerComponent('Picnic', () => App)
}
This main function is called from the top-level index.js
file used as the entrypoint for our React Native app:
// index.js
// We also import some polyfills etc. here, this should definitely not affect Instabug...
import { main } from './main'
main()
connectApp
initializes all of our app's business logic, including the module which creates the Query
traces which are causing the crash. It should hopefully not be important what's in connectApp
, I just wanted to highlight that we're definitely instantiating and enabling the Instabug module before we are instantiating any of our app's business logic, including the module which creates the Query
traces which are causing the crash.
The module in question really does not do anything strange, it literally just calls:
// See https://github.com/Instabug/Instabug-React-Native/issues/684
const trace = (await APM.startExecutionTrace('Query')) as unknown as Promise<Instabug.Trace>
// ...sometime later...
trace.setAttribute('name', name)
// ...sometime later...
trace.end()
Unfortunately I can't share any further source code in public, but I'd be happy to give you access to our Instabug account with plenty of examples of this crash occurring? Or alternatively we could continue this conversation privately if you'd prefer.
@lachenmayer Thank you for providing these details. We'll further investigate this on our side and keep you posted.
Closing this issue as we proceeded with the discussion privately. Please feel free to reopen the issue if it still persists.
@lachenmayer how did you fix this? I'm facing the same problem
Steps to Reproduce the Problem
APM.startExecutionTrace
at any point afterInstabug.start
Expected Behavior
Actual Behavior
(Captured via Instabug crash reporting - let me know if you want to see the actual crash)
Instabug integration code
SDK Version
10.13.0
React Native, iOS and Android Versions
React Native 0.66.4 iOS 15.3.1
Further comments