bugsnag / bugsnag-expo

MIT License
11 stars 5 forks source link

Builds with "expo publish" do not have the right sourcemap configurations. #133

Open dubchoi opened 1 year ago

dubchoi commented 1 year ago

Describe the bug

On new build updates with "expo publish", the reported bugs do not have the right source map configurations.

Steps to reproduce

  1. Using @bugsnag/expo and @bugsnag/plugin-expo-eas-sourcemaps v48.
  2. Currently we use eas builds but have not migrated to eas updates due to an outstanding blocking issue: https://github.com/bugsnag/bugsnag-expo/issues/48
  3. Make an eas build (any platform), and do an update with expo publish.
  4. Source maps are uploaded correctly for both eas builds and expo publish. Confirm on the bugsnag settings dashboard.
  5. Any bugs notified from the published do not have the right sourcemaps configurations and do not have the unobfuscated stacktraces.

Environment

What's happening

I went ahead and looked into what changed since this used to work before v48. I believe the culprit is https://github.com/bugsnag/bugsnag-expo/commit/a731586b130956c0fefb74a12e7d470988a523dc This change removes setting the right codeBundleId on the bugsnag notifier. It seems premature to do so since expo publish is still around, and bugsnag still doesn't officially support eas update.

johnkiely1 commented 1 year ago

Hi @dubchoi

Thanks for raising this, it does look like it was indeed an oversight on our part that Classic Update support was removed along with Classic Build in v48. We'll look to add this back into a release in due course. In the meantime, you could use the new codeBundleId config option to set it to the revisionId to pass the correct ID.

That would end up looking something like:

Bugsnag.start({
codeBundleId: Constants.manifest?.revisionId || Constants.manifest2?.extra?.expoClient?.revisionId  
})

Do let us know if you have any issues with this.

dubchoi commented 1 year ago

Hi I released with the suggested workaround.

However, I'm still having bugsnag show that the source mapping has failed. I'm receiving error events with the right configuration (In the "APP" tab of the event, I see the right "codeBundleId" set), and I also see that the source map for that codeBundleId has been successfully uploaded to bugsnag.

johnkiely1 commented 1 year ago

Hi @dubchoi, would you be able to write in to us at support@bugsnag.com with a link to the error in question in your Bugsnag dashboard. We can take a look for you to see if we can spot what's going on.