From 88c2ff385dbf334beb3704aacd5995f8681ac1db Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Sat, 9 Mar 2024 18:14:34 +0000 Subject: [PATCH 01/17] Set dev team in pod spec post_install --- .../react-native-cli/features/fixtures/rn0_66/ios/Podfile | 8 ++++++++ .../react-native-cli/features/fixtures/rn0_67/ios/Podfile | 8 ++++++++ .../features/fixtures/rn0_67_hermes/ios/Podfile | 8 ++++++++ .../react-native-cli/features/fixtures/rn0_69/ios/Podfile | 8 ++++++++ test/react-native/features/fixtures/rn0.66/ios/Podfile | 8 ++++++++ test/react-native/features/fixtures/rn0.67/ios/Podfile | 8 ++++++++ .../features/fixtures/rn0.68-hermes/ios/Podfile | 8 ++++++++ test/react-native/features/fixtures/rn0.69/ios/Podfile | 8 ++++++++ 8 files changed, 64 insertions(+) diff --git a/test/react-native-cli/features/fixtures/rn0_66/ios/Podfile b/test/react-native-cli/features/fixtures/rn0_66/ios/Podfile index a0238ea75d..fa69df7578 100644 --- a/test/react-native-cli/features/fixtures/rn0_66/ios/Podfile +++ b/test/react-native-cli/features/fixtures/rn0_66/ios/Podfile @@ -20,5 +20,13 @@ target 'rn0_66' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native-cli/features/fixtures/rn0_67/ios/Podfile b/test/react-native-cli/features/fixtures/rn0_67/ios/Podfile index b1660841b4..069c5a9c19 100644 --- a/test/react-native-cli/features/fixtures/rn0_67/ios/Podfile +++ b/test/react-native-cli/features/fixtures/rn0_67/ios/Podfile @@ -20,5 +20,13 @@ target 'rn0_67' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native-cli/features/fixtures/rn0_67_hermes/ios/Podfile b/test/react-native-cli/features/fixtures/rn0_67_hermes/ios/Podfile index dceb4d9132..0c323a8bf5 100644 --- a/test/react-native-cli/features/fixtures/rn0_67_hermes/ios/Podfile +++ b/test/react-native-cli/features/fixtures/rn0_67_hermes/ios/Podfile @@ -20,5 +20,13 @@ target 'rn0_67_hermes' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native-cli/features/fixtures/rn0_69/ios/Podfile b/test/react-native-cli/features/fixtures/rn0_69/ios/Podfile index 6a9228e99d..56b61705b9 100644 --- a/test/react-native-cli/features/fixtures/rn0_69/ios/Podfile +++ b/test/react-native-cli/features/fixtures/rn0_69/ios/Podfile @@ -27,5 +27,13 @@ target 'rn0_69' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native/features/fixtures/rn0.66/ios/Podfile b/test/react-native/features/fixtures/rn0.66/ios/Podfile index 78487cd490..2891e70f88 100644 --- a/test/react-native/features/fixtures/rn0.66/ios/Podfile +++ b/test/react-native/features/fixtures/rn0.66/ios/Podfile @@ -20,5 +20,13 @@ target 'reactnative' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native/features/fixtures/rn0.67/ios/Podfile b/test/react-native/features/fixtures/rn0.67/ios/Podfile index 78487cd490..2891e70f88 100644 --- a/test/react-native/features/fixtures/rn0.67/ios/Podfile +++ b/test/react-native/features/fixtures/rn0.67/ios/Podfile @@ -20,5 +20,13 @@ target 'reactnative' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native/features/fixtures/rn0.68-hermes/ios/Podfile b/test/react-native/features/fixtures/rn0.68-hermes/ios/Podfile index 716d34456d..bfa76d3507 100644 --- a/test/react-native/features/fixtures/rn0.68-hermes/ios/Podfile +++ b/test/react-native/features/fixtures/rn0.68-hermes/ios/Podfile @@ -27,5 +27,13 @@ target 'reactnative' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end diff --git a/test/react-native/features/fixtures/rn0.69/ios/Podfile b/test/react-native/features/fixtures/rn0.69/ios/Podfile index dbb8c3a002..778d5a8a62 100644 --- a/test/react-native/features/fixtures/rn0.69/ios/Podfile +++ b/test/react-native/features/fixtures/rn0.69/ios/Podfile @@ -27,5 +27,13 @@ target 'reactnative' do post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + installer.generated_projects.each do |project| + project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['DEVELOPMENT_TEAM'] = '7W9PZ27Y5F' + end + end + end end end From 9eb31b1f344f8c672b90ef73091dd8141c813fa2 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Mon, 11 Mar 2024 15:43:05 +0000 Subject: [PATCH 02/17] Use Xcode 14 --- .buildkite/full/react-native-cli-pipeline.full.yml | 6 +++--- .buildkite/full/react-native-ios-pipeline.full.yml | 12 ++++++------ .buildkite/pipeline.yml | 2 -- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.buildkite/full/react-native-cli-pipeline.full.yml b/.buildkite/full/react-native-cli-pipeline.full.yml index 10c0a64170..a4e7ab65aa 100644 --- a/.buildkite/full/react-native-cli-pipeline.full.yml +++ b/.buildkite/full/react-native-cli-pipeline.full.yml @@ -157,7 +157,7 @@ steps: env: DEBUG: true LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0_66.ipa commands: - test/react-native-cli/scripts/init-and-build-test.sh rn0_66 @@ -174,7 +174,7 @@ steps: env: DEBUG: true LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0_67.ipa commands: - test/react-native-cli/scripts/init-and-build-test.sh rn0_67 @@ -191,7 +191,7 @@ steps: env: DEBUG: true LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0_69.ipa commands: - test/react-native-cli/scripts/init-and-build-test.sh rn0_69 diff --git a/.buildkite/full/react-native-ios-pipeline.full.yml b/.buildkite/full/react-native-ios-pipeline.full.yml index 937b1f9522..d2b8d18844 100644 --- a/.buildkite/full/react-native-ios-pipeline.full.yml +++ b/.buildkite/full/react-native-ios-pipeline.full.yml @@ -14,7 +14,7 @@ steps: env: REACT_NATIVE_VERSION: rn0.66 LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0.66.ipa commands: - npm run test:build-react-native-ios @@ -31,7 +31,7 @@ steps: env: REACT_NATIVE_VERSION: rn0.67 LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0.67.ipa commands: - npm run test:build-react-native-ios @@ -48,7 +48,7 @@ steps: env: REACT_NATIVE_VERSION: rn0.68-hermes LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0.68-hermes.ipa commands: - npm run test:build-react-native-ios @@ -65,7 +65,7 @@ steps: env: REACT_NATIVE_VERSION: rn0.69 LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/rn0.69.ipa commands: - npm run test:build-react-native-ios @@ -122,7 +122,7 @@ steps: JS_SOURCE_DIR: "react_navigation_js" ARTEFACT_NAME: "r_navigation_0.69" LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/r_navigation_0.69.ipa commands: - npm run test:build-react-native-ios @@ -143,7 +143,7 @@ steps: JS_SOURCE_DIR: "react_native_navigation_js" ARTEFACT_NAME: "r_native_navigation_0.66" LANG: "en_US.UTF-8" - DEVELOPER_DIR: "/Applications/Xcode13.app" + DEVELOPER_DIR: "/Applications/Xcode14.app" artifact_paths: build/r_native_navigation_0.66.ipa commands: - npm run test:build-react-native-ios diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0068a76a59..d27f869b47 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -7,8 +7,6 @@ steps: timeout_in_minutes: 20 agents: queue: macos-12-arm - env: - DEVELOPER_DIR: /Applications/Xcode13.4.app command: scripts/license_finder.sh # From ccbeb6bedd83197f984378f861f5fa6c073d2500 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Mon, 11 Mar 2024 15:43:17 +0000 Subject: [PATCH 03/17] Skip troublesome Expo 50 [full circle] --- .buildkite/full/pipeline.full.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.buildkite/full/pipeline.full.yml b/.buildkite/full/pipeline.full.yml index 2c24cff1ce..101495bc79 100644 --- a/.buildkite/full/pipeline.full.yml +++ b/.buildkite/full/pipeline.full.yml @@ -25,8 +25,10 @@ steps: # # Trigger Expo pipelines + # TODO: Skip pending PLAT-11676 and PLAT-11745 # - label: "@bugsnag/expo latest" + skip: PLAT-11676 and PLAT-11745 depends_on: "publish-js" trigger: "bugsnag-expo" build: @@ -58,4 +60,4 @@ steps: BUGSNAG_JS_BRANCH: "${BUILDKITE_BRANCH}" BUGSNAG_JS_COMMIT: "${BUILDKITE_COMMIT}" # a branch name that's safe to use as a docker cache identifier - BUGSNAG_JS_CACHE_SAFE_BRANCH_NAME: "${BRANCH_NAME}" \ No newline at end of file + BUGSNAG_JS_CACHE_SAFE_BRANCH_NAME: "${BRANCH_NAME}" From 802768a51918496bcd3c7a3091e965746cee0682 Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Mon, 11 Mar 2024 21:08:54 +0000 Subject: [PATCH 04/17] Pass API key through to tests (#2096) --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index ebfb1e91b5..e495642e4a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ x-common-environment: &common-environment BROWSER_STACK_DEVICES_USERNAME: BROWSER_STACK_DEVICES_ACCESS_KEY: SKIP_NAVIGATION_SCENARIOS: + MAZE_SCENARIO_BUGSNAG_API_KEY: services: minimal-packager: From cf57dd9e4fe30c68b3f63f43b89fdbf0a3549c91 Mon Sep 17 00:00:00 2001 From: AnastasiiaSvietlova <119674359+AnastasiiaSvietlova@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:06:53 +0100 Subject: [PATCH 05/17] Improved performance of click event breadcrumbs (#2094) * Improved performance of click event breadcrumbs * add change log * changed regex * revert changelog formatting * changelog --- CHANGELOG.md | 6 ++++++ .../interaction-breadcrumbs.js | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61f0dcd467..c13092ca9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## TBD + +### Changed + +- (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) + ## v7.22.6 (2024-03-05) ### Changed diff --git a/packages/plugin-interaction-breadcrumbs/interaction-breadcrumbs.js b/packages/plugin-interaction-breadcrumbs/interaction-breadcrumbs.js index d1380813ca..86c7b03086 100644 --- a/packages/plugin-interaction-breadcrumbs/interaction-breadcrumbs.js +++ b/packages/plugin-interaction-breadcrumbs/interaction-breadcrumbs.js @@ -21,8 +21,7 @@ module.exports = (win = window) => ({ } }) -const trimStart = /^\s+/ -const trimEnd = /(^|[^\s])\s+$/ +const trim = /^\s*([^\s][\s\S]{0,139}[^\s])?\s*/ function getNodeText (el) { let text = el.textContent || el.innerText || '' @@ -31,7 +30,7 @@ function getNodeText (el) { text = el.value } - text = text.replace(trimStart, '').replace(trimEnd, '$1') + text = text.replace(trim, '$1') if (text.length > 140) { return text.slice(0, 135) + '(...)' From 05b5617db13b81eef269680f8fc6d401bf3e99d7 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 19 Mar 2024 09:06:59 +0000 Subject: [PATCH 06/17] remove version from cocoapods --- examples/reactnative/rn071example/Gemfile | 2 +- test/react-native-cli/features/fixtures/rn0_67/Gemfile | 2 +- .../react-native-cli/features/fixtures/rn0_67_hermes/Gemfile | 2 +- test/react-native-cli/features/fixtures/rn0_69/Gemfile | 2 +- test/react-native/features/fixtures/rn0.67/Gemfile | 2 +- test/react-native/features/fixtures/rn0.68-hermes/Gemfile | 2 +- test/react-native/features/fixtures/rn0.69/Gemfile | 4 ++-- test/react-native/features/fixtures/rn0.71/Gemfile | 2 +- test/react-native/features/fixtures/rn0.72/Gemfile | 4 ++-- test/react-native/features/fixtures/rn0.73/Gemfile | 5 ++--- 10 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/reactnative/rn071example/Gemfile b/examples/reactnative/rn071example/Gemfile index 567e59805c..33990a566b 100644 --- a/examples/reactnative/rn071example/Gemfile +++ b/examples/reactnative/rn071example/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby File.read(File.join(__dir__, '.ruby-version')).strip -gem 'cocoapods', '~> 1.11', '>= 1.11.3' +gem 'cocoapods' diff --git a/test/react-native-cli/features/fixtures/rn0_67/Gemfile b/test/react-native-cli/features/fixtures/rn0_67/Gemfile index 048c0c7251..d98f04da89 100644 --- a/test/react-native-cli/features/fixtures/rn0_67/Gemfile +++ b/test/react-native-cli/features/fixtures/rn0_67/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods' diff --git a/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile b/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile index 048c0c7251..d98f04da89 100644 --- a/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile +++ b/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods' diff --git a/test/react-native-cli/features/fixtures/rn0_69/Gemfile b/test/react-native-cli/features/fixtures/rn0_69/Gemfile index 5efda89f45..44656f2a96 100644 --- a/test/react-native-cli/features/fixtures/rn0_69/Gemfile +++ b/test/react-native-cli/features/fixtures/rn0_69/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.5' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods' diff --git a/test/react-native/features/fixtures/rn0.67/Gemfile b/test/react-native/features/fixtures/rn0.67/Gemfile index 048c0c7251..d98f04da89 100644 --- a/test/react-native/features/fixtures/rn0.67/Gemfile +++ b/test/react-native/features/fixtures/rn0.67/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods' diff --git a/test/react-native/features/fixtures/rn0.68-hermes/Gemfile b/test/react-native/features/fixtures/rn0.68-hermes/Gemfile index 048c0c7251..d98f04da89 100644 --- a/test/react-native/features/fixtures/rn0.68-hermes/Gemfile +++ b/test/react-native/features/fixtures/rn0.68-hermes/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods' diff --git a/test/react-native/features/fixtures/rn0.69/Gemfile b/test/react-native/features/fixtures/rn0.69/Gemfile index 5efda89f45..e5a790714f 100644 --- a/test/react-native/features/fixtures/rn0.69/Gemfile +++ b/test/react-native/features/fixtures/rn0.69/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '2.7.5' +# ruby '2.7.5' -gem 'cocoapods', '~> 1.11', '>= 1.11.2' +gem 'cocoapods' diff --git a/test/react-native/features/fixtures/rn0.71/Gemfile b/test/react-native/features/fixtures/rn0.71/Gemfile index 567e59805c..33990a566b 100644 --- a/test/react-native/features/fixtures/rn0.71/Gemfile +++ b/test/react-native/features/fixtures/rn0.71/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby File.read(File.join(__dir__, '.ruby-version')).strip -gem 'cocoapods', '~> 1.11', '>= 1.11.3' +gem 'cocoapods' diff --git a/test/react-native/features/fixtures/rn0.72/Gemfile b/test/react-native/features/fixtures/rn0.72/Gemfile index 1fa2c2e1ab..68516afb1a 100644 --- a/test/react-native/features/fixtures/rn0.72/Gemfile +++ b/test/react-native/features/fixtures/rn0.72/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby ">= 2.6.10" +# ruby ">= 2.6.10" -gem 'cocoapods', '~> 1.12' +gem 'cocoapods' diff --git a/test/react-native/features/fixtures/rn0.73/Gemfile b/test/react-native/features/fixtures/rn0.73/Gemfile index 6a7d5c7a49..68516afb1a 100644 --- a/test/react-native/features/fixtures/rn0.73/Gemfile +++ b/test/react-native/features/fixtures/rn0.73/Gemfile @@ -1,7 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby ">= 2.6.10" +# ruby ">= 2.6.10" -gem 'cocoapods', '~> 1.13' -gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' +gem 'cocoapods' From 2d9da8265b56adcd2c33a182af3d6644740559b4 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 19 Mar 2024 09:07:53 +0000 Subject: [PATCH 07/17] Revert "remove version from cocoapods" This reverts commit 05b5617db13b81eef269680f8fc6d401bf3e99d7. --- examples/reactnative/rn071example/Gemfile | 2 +- test/react-native-cli/features/fixtures/rn0_67/Gemfile | 2 +- .../react-native-cli/features/fixtures/rn0_67_hermes/Gemfile | 2 +- test/react-native-cli/features/fixtures/rn0_69/Gemfile | 2 +- test/react-native/features/fixtures/rn0.67/Gemfile | 2 +- test/react-native/features/fixtures/rn0.68-hermes/Gemfile | 2 +- test/react-native/features/fixtures/rn0.69/Gemfile | 4 ++-- test/react-native/features/fixtures/rn0.71/Gemfile | 2 +- test/react-native/features/fixtures/rn0.72/Gemfile | 4 ++-- test/react-native/features/fixtures/rn0.73/Gemfile | 5 +++-- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/reactnative/rn071example/Gemfile b/examples/reactnative/rn071example/Gemfile index 33990a566b..567e59805c 100644 --- a/examples/reactnative/rn071example/Gemfile +++ b/examples/reactnative/rn071example/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby File.read(File.join(__dir__, '.ruby-version')).strip -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.3' diff --git a/test/react-native-cli/features/fixtures/rn0_67/Gemfile b/test/react-native-cli/features/fixtures/rn0_67/Gemfile index d98f04da89..048c0c7251 100644 --- a/test/react-native-cli/features/fixtures/rn0_67/Gemfile +++ b/test/react-native-cli/features/fixtures/rn0_67/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.2' diff --git a/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile b/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile index d98f04da89..048c0c7251 100644 --- a/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile +++ b/test/react-native-cli/features/fixtures/rn0_67_hermes/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.2' diff --git a/test/react-native-cli/features/fixtures/rn0_69/Gemfile b/test/react-native-cli/features/fixtures/rn0_69/Gemfile index 44656f2a96..5efda89f45 100644 --- a/test/react-native-cli/features/fixtures/rn0_69/Gemfile +++ b/test/react-native-cli/features/fixtures/rn0_69/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.5' -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.2' diff --git a/test/react-native/features/fixtures/rn0.67/Gemfile b/test/react-native/features/fixtures/rn0.67/Gemfile index d98f04da89..048c0c7251 100644 --- a/test/react-native/features/fixtures/rn0.67/Gemfile +++ b/test/react-native/features/fixtures/rn0.67/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.2' diff --git a/test/react-native/features/fixtures/rn0.68-hermes/Gemfile b/test/react-native/features/fixtures/rn0.68-hermes/Gemfile index d98f04da89..048c0c7251 100644 --- a/test/react-native/features/fixtures/rn0.68-hermes/Gemfile +++ b/test/react-native/features/fixtures/rn0.68-hermes/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby '2.7.7' -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.2' diff --git a/test/react-native/features/fixtures/rn0.69/Gemfile b/test/react-native/features/fixtures/rn0.69/Gemfile index e5a790714f..5efda89f45 100644 --- a/test/react-native/features/fixtures/rn0.69/Gemfile +++ b/test/react-native/features/fixtures/rn0.69/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -# ruby '2.7.5' +ruby '2.7.5' -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.2' diff --git a/test/react-native/features/fixtures/rn0.71/Gemfile b/test/react-native/features/fixtures/rn0.71/Gemfile index 33990a566b..567e59805c 100644 --- a/test/react-native/features/fixtures/rn0.71/Gemfile +++ b/test/react-native/features/fixtures/rn0.71/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby File.read(File.join(__dir__, '.ruby-version')).strip -gem 'cocoapods' +gem 'cocoapods', '~> 1.11', '>= 1.11.3' diff --git a/test/react-native/features/fixtures/rn0.72/Gemfile b/test/react-native/features/fixtures/rn0.72/Gemfile index 68516afb1a..1fa2c2e1ab 100644 --- a/test/react-native/features/fixtures/rn0.72/Gemfile +++ b/test/react-native/features/fixtures/rn0.72/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -# ruby ">= 2.6.10" +ruby ">= 2.6.10" -gem 'cocoapods' +gem 'cocoapods', '~> 1.12' diff --git a/test/react-native/features/fixtures/rn0.73/Gemfile b/test/react-native/features/fixtures/rn0.73/Gemfile index 68516afb1a..6a7d5c7a49 100644 --- a/test/react-native/features/fixtures/rn0.73/Gemfile +++ b/test/react-native/features/fixtures/rn0.73/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -# ruby ">= 2.6.10" +ruby ">= 2.6.10" -gem 'cocoapods' +gem 'cocoapods', '~> 1.13' +gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' From f622eec264906856c37846db0bd816cb31ffb509 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 19 Mar 2024 09:09:12 +0000 Subject: [PATCH 08/17] update cocoapds version for rn 0.73 --- test/react-native/features/fixtures/rn0.73/Gemfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/react-native/features/fixtures/rn0.73/Gemfile b/test/react-native/features/fixtures/rn0.73/Gemfile index 6a7d5c7a49..2aa92c5d0a 100644 --- a/test/react-native/features/fixtures/rn0.73/Gemfile +++ b/test/react-native/features/fixtures/rn0.73/Gemfile @@ -3,5 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -gem 'cocoapods', '~> 1.13' -gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' +gem 'cocoapods' From b8b1236756131717e3b102994d8729e9b7fcfa12 Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 19 Mar 2024 09:13:43 +0000 Subject: [PATCH 09/17] set cocoapods version for rn 0.73 to 1.14.3 --- test/react-native/features/fixtures/rn0.73/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/react-native/features/fixtures/rn0.73/Gemfile b/test/react-native/features/fixtures/rn0.73/Gemfile index 2aa92c5d0a..b5ea506d70 100644 --- a/test/react-native/features/fixtures/rn0.73/Gemfile +++ b/test/react-native/features/fixtures/rn0.73/Gemfile @@ -3,4 +3,4 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -gem 'cocoapods' +gem 'cocoapods', '~> 1.14.3' From af8c6e708bcda4517238c1f2ac36bca127c5fe8f Mon Sep 17 00:00:00 2001 From: Josh Edney Date: Tue, 19 Mar 2024 09:19:47 +0000 Subject: [PATCH 10/17] set cocoapods version for rn 0.73 to 1.14.3 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 00a6b3f80e..4a3d1c21b0 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem 'cocoapods' +gem 'cocoapods', '~> 1.14.3' From d55d69594d7d893dd63596d7fa8dbeca6900a8e4 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Mon, 25 Mar 2024 12:58:14 +0000 Subject: [PATCH 11/17] Build on macOS 14 --- .buildkite/pipeline.yml | 7 +++-- .npmrc | 1 + Gemfile.lock | 63 ++++++++++++++++++++++++----------------- 3 files changed, 42 insertions(+), 29 deletions(-) create mode 100644 .npmrc diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d27f869b47..dd68fdc2fb 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -55,15 +55,16 @@ steps: - docker-compose#v4.12.0: run: minimal-packager artifact_paths: min_packages.tar - - label: ":docker: Build and publish JS packages" key: "publish-js" timeout_in_minutes: 30 agents: - queue: "macos-12-arm" + queue: "macos-14" env: - NODE_VERSION: "14" + NODE_VERSION: "18" + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" command: + - "bundle install" - "node scripts/publish.js $$PUBLISH_URL" retry: automatic: diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..521a9f7c07 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/Gemfile.lock b/Gemfile.lock index 0b55f642ce..3575697d3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,30 +1,38 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.7) + base64 + nkf rexml - activesupport (6.1.7) + activesupport (7.1.3.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.1) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) + base64 (0.2.0) + bigdecimal (3.1.7) claide (1.1.0) - cocoapods (1.11.3) + cocoapods (1.14.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) + cocoapods-core (= 1.14.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -32,10 +40,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.14.3) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -45,7 +53,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.6.3) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -54,44 +62,47 @@ GEM netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + drb (2.2.1) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) - ffi (1.15.5) + ffi (1.16.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.4) concurrent-ruby (~> 1.0) - json (2.6.2) - minitest (5.16.3) + json (2.7.1) + minitest (5.22.3) molinillo (0.8.0) + mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) + nkf (0.2.0) public_suffix (4.0.7) - rexml (3.2.5) + rexml (3.2.6) ruby-macho (2.5.1) - typhoeus (1.4.0) + typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - xcodeproj (1.22.0) + xcodeproj (1.24.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.6.1) PLATFORMS ruby DEPENDENCIES - cocoapods + cocoapods (~> 1.14.3) BUNDLED WITH - 2.2.33 + 2.4.8 From d898b48c4a54b48e090f8a4956cb31019cb8c631 Mon Sep 17 00:00:00 2001 From: Matt d'Entremont Date: Thu, 23 Feb 2023 09:56:07 -0400 Subject: [PATCH 12/17] Export BrowserBugsnagStatic - Allows the correct type to be imported in projects which use bugsnag --- packages/browser/types/bugsnag.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser/types/bugsnag.d.ts b/packages/browser/types/bugsnag.d.ts index f9db2ea745..d198264fb7 100644 --- a/packages/browser/types/bugsnag.d.ts +++ b/packages/browser/types/bugsnag.d.ts @@ -7,7 +7,7 @@ interface BrowserConfig extends Config { trackInlineScripts?: boolean } -interface BrowserBugsnagStatic extends BugsnagStatic { +export interface BrowserBugsnagStatic extends BugsnagStatic { start(apiKeyOrOpts: string | BrowserConfig): Client createClient(apiKeyOrOpts: string | BrowserConfig): Client } From d055400bc406e0cf07a1a7663ac0a927e67d5fe3 Mon Sep 17 00:00:00 2001 From: Yousif <74918474+yousif-bugsnag@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:20:34 +0100 Subject: [PATCH 13/17] feat(react-native): move BugsnagReactNative from obj-c to obj-c++ * bump RN 0.72 test fixture from 0.72.3 to 0.72.12 * feat: move BugsnagReactNative from obj-c to obj-c++ --- packages/react-native/BugsnagReactNative.podspec | 2 +- .../ios/BugsnagReactNative/BugsnagReactNative.h | 2 ++ .../{BugsnagReactNative.m => BugsnagReactNative.mm} | 0 test/react-native/features/fixtures/rn0.72/Gemfile | 5 ++++- test/react-native/features/fixtures/rn0.72/package.json | 6 +++--- 5 files changed, 10 insertions(+), 5 deletions(-) rename packages/react-native/ios/BugsnagReactNative/{BugsnagReactNative.m => BugsnagReactNative.mm} (100%) diff --git a/packages/react-native/BugsnagReactNative.podspec b/packages/react-native/BugsnagReactNative.podspec index 13f16170e8..c8c660ab9b 100644 --- a/packages/react-native/BugsnagReactNative.podspec +++ b/packages/react-native/BugsnagReactNative.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.author = { "Bugsnag" => "platforms@bugsnag.com" } s.platform = :ios, "9.0" s.source = { :git => "https://github.com/bugsnag/bugsnag-js.git", :tag => "v#{s.version}" } - s.source_files = "ios/BugsnagReactNative/**/*.{h,m}", + s.source_files = "ios/BugsnagReactNative/**/*.{h,mm,m}", "ios/vendor/bugsnag-cocoa/**/*.{h,mm,m,cpp,c}", s.public_header_files = "ios/vendor/bugsnag-cocoa/{#{bugsnag_cocoa_public_header_files.join(',')}}" s.header_dir = 'Bugsnag' diff --git a/packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.h b/packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.h index 9f8195f449..e3c6a2930d 100644 --- a/packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.h +++ b/packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.h @@ -5,6 +5,8 @@ #ifdef RCT_NEW_ARCH_ENABLED #import + +#import "BugsnagReactNativeEmitter.h" #endif @class BugsnagConfiguration; diff --git a/packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.m b/packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.mm similarity index 100% rename from packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.m rename to packages/react-native/ios/BugsnagReactNative/BugsnagReactNative.mm diff --git a/test/react-native/features/fixtures/rn0.72/Gemfile b/test/react-native/features/fixtures/rn0.72/Gemfile index 1fa2c2e1ab..b550fb64d2 100644 --- a/test/react-native/features/fixtures/rn0.72/Gemfile +++ b/test/react-native/features/fixtures/rn0.72/Gemfile @@ -3,4 +3,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -gem 'cocoapods', '~> 1.12' +# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper +# bound in the template on Cocoapods with next React Native release. +gem 'cocoapods', '>= 1.13', '< 1.15' +gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' diff --git a/test/react-native/features/fixtures/rn0.72/package.json b/test/react-native/features/fixtures/rn0.72/package.json index 76e12e3ac2..ba7e0655c0 100644 --- a/test/react-native/features/fixtures/rn0.72/package.json +++ b/test/react-native/features/fixtures/rn0.72/package.json @@ -11,21 +11,21 @@ }, "dependencies": { "react": "18.2.0", - "react-native": "0.72.3" + "react-native": "0.72.12" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/eslint-config": "^0.72.2", - "@react-native/metro-config": "^0.72.9", + "@react-native/metro-config": "^0.72.12", "@tsconfig/react-native": "^3.0.0", "@types/react": "^18.0.24", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.2.1", "eslint": "^8.19.0", "jest": "^29.2.1", - "metro-react-native-babel-preset": "0.76.7", + "metro-react-native-babel-preset": "^0.76.9", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" From be1ea1da6557ce87e50e10864e98fe2ac66eb806 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Wed, 10 Apr 2024 13:28:20 +0100 Subject: [PATCH 14/17] [PLAT-11955] Rename Bugsnag.framework (#2117) * refactor: :truck: rename Bugsnag.framework to BugsnagReactNative.framework * docs: :memo: add changelog entry --- CHANGELOG.md | 1 + .../project.pbxproj | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c13092ca9f..6a74dc2ef7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changed - (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) +- (react-native) Rename Bugsnag.framework to BugsnagReactNative.framework [#2117](https://github.com/bugsnag/bugsnag-js/pull/2117) ## v7.22.6 (2024-03-05) diff --git a/packages/react-native/ios/BugsnagReactNative.xcodeproj/project.pbxproj b/packages/react-native/ios/BugsnagReactNative.xcodeproj/project.pbxproj index 108ff5bcbf..45b4099ad0 100644 --- a/packages/react-native/ios/BugsnagReactNative.xcodeproj/project.pbxproj +++ b/packages/react-native/ios/BugsnagReactNative.xcodeproj/project.pbxproj @@ -327,9 +327,9 @@ E7462A782489461A00F92D67 /* Products */ = { isa = PBXGroup; children = ( - E7462A822489461A00F92D67 /* Bugsnag.framework */, - E7462A842489461A00F92D67 /* Bugsnag.framework */, - E7462A862489461A00F92D67 /* Bugsnag.framework */, + E7462A822489461A00F92D67 /* BugsnagReactNative.framework */, + E7462A842489461A00F92D67 /* BugsnagReactNative.framework */, + E7462A862489461A00F92D67 /* BugsnagReactNative.framework */, E7462A882489461A00F92D67 /* libBugsnagStatic.a */, E7462A8A2489461A00F92D67 /* Bugsnag-iOSTests.xctest */, E7462A8C2489461A00F92D67 /* Bugsnag-macOSTests.xctest */, @@ -514,24 +514,24 @@ remoteRef = E72B3248241FC479005FB2CA /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - E7462A822489461A00F92D67 /* Bugsnag.framework */ = { + E7462A822489461A00F92D67 /* BugsnagReactNative.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = Bugsnag.framework; + path = BugsnagReactNative.framework; remoteRef = E7462A812489461A00F92D67 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - E7462A842489461A00F92D67 /* Bugsnag.framework */ = { + E7462A842489461A00F92D67 /* BugsnagReactNative.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = Bugsnag.framework; + path = BugsnagReactNative.framework; remoteRef = E7462A832489461A00F92D67 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - E7462A862489461A00F92D67 /* Bugsnag.framework */ = { + E7462A862489461A00F92D67 /* BugsnagReactNative.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = Bugsnag.framework; + path = BugsnagReactNative.framework; remoteRef = E7462A852489461A00F92D67 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; From f1a21676be5c4d2daa6fb8cfed58256fcb45c990 Mon Sep 17 00:00:00 2001 From: AnastasiiaSvietlova <119674359+AnastasiiaSvietlova@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:45:55 +0200 Subject: [PATCH 15/17] Preventing prototype pollution vulnerabilities (#2115) * Preventing prototype pollution vulnerabilities * added changelog.md * changed changelog * added each in tests * fixed test description * fixed vulnerability for add method * fixed tests and changelog as suggested --- CHANGELOG.md | 1 + packages/core/lib/metadata-delegate.js | 10 ++++ packages/core/test/metadata-delegate.test.js | 58 ++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 packages/core/test/metadata-delegate.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a74dc2ef7..67dace675a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Changed +- (metadata-delegate) Preventing prototype pollution vulnerabilities [#2115](https://github.com/bugsnag/bugsnag-js/pull/2115) - (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) - (react-native) Rename Bugsnag.framework to BugsnagReactNative.framework [#2117](https://github.com/bugsnag/bugsnag-js/pull/2117) diff --git a/packages/core/lib/metadata-delegate.js b/packages/core/lib/metadata-delegate.js index a5008edd4d..ae5db228a9 100644 --- a/packages/core/lib/metadata-delegate.js +++ b/packages/core/lib/metadata-delegate.js @@ -14,6 +14,11 @@ const add = (state, section, keyOrObj, maybeVal) => { // exit if we don't have an updates object at this point if (!updates) return + // preventing the __proto__ property from being used as a key + if (section === '__proto__' || section === 'constructor' || section === 'prototype') { + return + } + // ensure a section with this name exists if (!state[section]) state[section] = {} @@ -41,6 +46,11 @@ const clear = (state, section, key) => { return } + // preventing the __proto__ property from being used as a key + if (section === '__proto__' || section === 'constructor' || section === 'prototype') { + return + } + // clear a single value from a section if (state[section]) { delete state[section][key] diff --git a/packages/core/test/metadata-delegate.test.js b/packages/core/test/metadata-delegate.test.js new file mode 100644 index 0000000000..3dded77630 --- /dev/null +++ b/packages/core/test/metadata-delegate.test.js @@ -0,0 +1,58 @@ +import { add, clear } from '../lib/metadata-delegate' + +// it doesn't seem easy or even impossible to check whether __proto__ keys can be overwritten +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto +// so tests are only for prototype and constructor + +describe('metadata delegate', () => { + describe('add', () => { + it.each([ + { + key: 'constructor', + expected: {} + }, + { + key: 'prototype', + expected: {} + } + ])('should not add $key keys', ({ key, expected }) => { + const state = {} + add(state, key, 'foo', 'bar') + expect(state).toEqual(expected) + }) + }) + + describe('clear', () => { + it.each([ + { + key: 'constructor', + state: { + constructor: { + foo: 'bar' + } + }, + expected: { + constructor: { + foo: 'bar' + } + } + }, + { + key: 'prototype', + state: { + prototype: { + foo: 'bar' + } + }, + expected: { + prototype: { + foo: 'bar' + } + } + } + ])('should not overwrite $key keys', ({ key, state, expected }) => { + clear(state, key, 'foo') + expect(state).toEqual(expected) + }) + }) +}) From 2e5f015be521b3727fbad72bca3e95a659e53951 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Mon, 15 Apr 2024 14:54:22 +0100 Subject: [PATCH 16/17] test: :white_check_mark: skip failing test on android (#2110) --- .../features/run-app-tests/run-and-notify.feature | 1 + test/react-native-cli/features/support/env.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/test/react-native-cli/features/run-app-tests/run-and-notify.feature b/test/react-native-cli/features/run-app-tests/run-and-notify.feature index 816daeee56..88a3502e30 100644 --- a/test/react-native-cli/features/run-app-tests/run-and-notify.feature +++ b/test/react-native-cli/features/run-app-tests/run-and-notify.feature @@ -1,5 +1,6 @@ Feature: Tests for running a React Native app that was initialized using the Bugsnag React Native CLI +@ios_only # Skip this feature on Android until issue with Selenium and BitBar has been resolved PLAT-11897 Scenario: A built, CLI initialized, app sends JavaScript and Native handled errors When I wait to receive at least 1 session Then the session is valid for the session reporting API version "1.0" for the React Native notifier diff --git a/test/react-native-cli/features/support/env.rb b/test/react-native-cli/features/support/env.rb index 77fe07c2c3..e239bbde0f 100644 --- a/test/react-native-cli/features/support/env.rb +++ b/test/react-native-cli/features/support/env.rb @@ -4,3 +4,7 @@ # Build requests are JSON but do not have the integrity header by design Maze.config.enforce_bugsnag_integrity = false end + +Before('@ios_only') do |_scenario| + skip_this_scenario("Skipping scenario") unless Maze::Helper.get_current_platform == 'ios' +end From e70b1a90ec1288aa6fa0865e60f93498560dc774 Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Wed, 17 Apr 2024 14:39:36 +0100 Subject: [PATCH 17/17] release v7.22.7 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67dace675a..c26e6905e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,17 @@ # Changelog -## TBD +## v7.22.7 (2024-04-17) ### Changed - (metadata-delegate) Preventing prototype pollution vulnerabilities [#2115](https://github.com/bugsnag/bugsnag-js/pull/2115) - (plugin-interaction-breadcrumbs) Improved performance of click event breadcrumbs [#2094](https://github.com/bugsnag/bugsnag-js/pull/2094) - (react-native) Rename Bugsnag.framework to BugsnagReactNative.framework [#2117](https://github.com/bugsnag/bugsnag-js/pull/2117) +- (browser) Export BrowserBugsnagStatic [#2112](https://github.com/bugsnag/bugsnag-js/pull/2112) + +### Fixed + +- (react-native) Move BugsnagReactNative from objective-c to objective c++ [#2113](https://github.com/bugsnag/bugsnag-js/pull/2113) ## v7.22.6 (2024-03-05)