Skip to content

Commit

Permalink
Merge pull request #146 from bugsnag/release/v49.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag committed Aug 3, 2023
2 parents 088559c + e7fce4b commit 5c708b7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v49.0.1 (2023-08-03)

### Fixed

- Fix a crash in configuration when Constants.expoGoConfig is null [#145](https://github.com/bugsnag/bugsnag-expo/pull/145)

## v49.0.0 (2023-07-13)

This release adds support for expo 49
Expand Down
2 changes: 1 addition & 1 deletion packages/expo/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const stringWithLength = require('@bugsnag/core/lib/validators/string-with-lengt
// If the developer property is not present it means the app is
// not connected to a development tool and is either a published app running in
// the Expo client, or a standalone app
const IS_PRODUCTION = !Constants.expoConfig.developer && !Constants.expoGoConfig.developer
const IS_PRODUCTION = !Constants.expoConfig?.developer && !Constants.expoGoConfig?.developer

// The app can still run in production "mode" in development environments, in which
// cases the global boolean __DEV__ will be set to true
Expand Down
6 changes: 3 additions & 3 deletions packages/expo/src/notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const internalPlugins = [
require('@bugsnag/plugin-expo-device'),
require('@bugsnag/plugin-expo-app'),
require('@bugsnag/plugin-console-breadcrumbs'),
require('@bugsnag/plugin-network-breadcrumbs')([NET_INFO_REACHABILITY_URL, Constants.expoConfig.logUrl || Constants.expoGoConfig?.logUrl]),
require('@bugsnag/plugin-network-breadcrumbs')([NET_INFO_REACHABILITY_URL, Constants.expoConfig?.logUrl || Constants.expoGoConfig?.logUrl]),
require('@bugsnag/plugin-expo-app-state-breadcrumbs'),
require('@bugsnag/plugin-expo-connectivity-breadcrumbs'),
require('@bugsnag/plugin-react-native-orientation-breadcrumbs'),
Expand All @@ -45,12 +45,12 @@ const Bugsnag = {

// read the api key from app.json if one is not explicitly passed
if (!opts.apiKey) {
opts.apiKey = Constants.expoConfig.extra?.bugsnag?.apiKey
opts.apiKey = Constants.expoConfig?.extra?.bugsnag?.apiKey
}

// read the version from app.json if one is not explicitly passed
if (!opts.appVersion) {
opts.appVersion = Constants.expoConfig.version
opts.appVersion = Constants.expoConfig?.version
}

const bugsnag = new Client(opts, schema, internalPlugins, { name, version, url })
Expand Down
12 changes: 6 additions & 6 deletions packages/expo/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ jest.mock('expo-constants', () => ({
default: {
platform: {},
expoConfig: {},
expoGoConfig: {}
expoGoConfig: null
}
}))

jest.mock('../../plugin-expo-device/node_modules/expo-constants', () => ({
default: {
platform: {},
expoConfig: {},
expoGoConfig: {}
expoGoConfig: null
}
}))

Expand All @@ -22,7 +22,7 @@ jest.mock('../../plugin-expo-app/node_modules/expo-constants', () => ({
default: {
platform: {},
expoConfig: {},
expoGoConfig: {}
expoGoConfig: null
}
}))

Expand Down Expand Up @@ -244,7 +244,7 @@ describe('expo notifier', () => {
default: {
platform: {},
expoConfig: {},
expoGoConfig: {}
expoGoConfig: null
}
}))

Expand All @@ -256,7 +256,7 @@ describe('expo notifier', () => {
jest.mock('expo-constants', () => ({
default: {
platform: {},
expoConfig: {},
expoConfig: null,
expoGoConfig: {
developer: {
tool: 'expo-cli'
Expand All @@ -279,7 +279,7 @@ describe('expo notifier', () => {
tool: 'expo-cli'
}
},
expoGoConfig: {}
expoGoConfig: null
}
}))

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-expo-device/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
runtimeVersions: {
reactNative: rnVersion,
expoApp: Constants.expoVersion,
expoSdk: Constants.expoConfig.sdkVersion,
expoSdk: Constants.expoConfig?.sdkVersion,
androidApiLevel: Constants.platform.android ? String(Platform.Version) : undefined
},
totalMemory: Device.totalMemory
Expand Down

0 comments on commit 5c708b7

Please sign in to comment.