Skip to content

Commit

Permalink
Merge pull request #1715 from bugsnag/release/v7.16.3
Browse files Browse the repository at this point in the history
Release v7.16.3
  • Loading branch information
imjoehaines committed Apr 5, 2022
2 parents 58c0ade + 2d72317 commit 4160098
Show file tree
Hide file tree
Showing 470 changed files with 66,999 additions and 12,116 deletions.
301 changes: 281 additions & 20 deletions .buildkite/react-native-cli-pipeline.yml

Large diffs are not rendered by default.

211 changes: 143 additions & 68 deletions .buildkite/react-native-pipeline.yml

Large diffs are not rendered by default.

37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# Changelog

### v7.16.2 (2022-03-09)
## v7.16.3 (2022-04-05)

### Changed

- (react-native) Update bugsnag-android to v5.22.0
- The number of threads reported can now be limited using `Configuration.setMaxReportedThreads` (defaulting to 200)
[bugsnag-android#1607](https://github.com/bugsnag/bugsnag-android/pull/1607)
- Improved the performance and stability of the NDK and ANR plugins by caching JNI references on start
[bugsnag-android#1596](https://github.com/bugsnag/bugsnag-android/pull/1596)
[bugsnag-android#1601](https://github.com/bugsnag/bugsnag-android/pull/1601)
- Fix inconsistencies in stack trace quality for C/C++ events. Resolves a few
cases where file and line number information was not resolving to the correct
locations. This change may result in grouping changes to more correctly
highlight the root cause of an event.
[bugsnag-android#1605](https://github.com/bugsnag/bugsnag-android/pull/1605)
[bugsnag-android#1606](https://github.com/bugsnag/bugsnag-android/pull/1606)
- Fixed an issue where an uncaught exception on the main thread could in rare cases trigger an ANR.
[bugsnag-android#1624](https://github.com/bugsnag/bugsnag-android/pull/1624)
- Added `Bugsnag.isStarted()` to test whether the Bugsnag client is in the middle of initializing. This can be used to guard uses of the Bugsnag API that are either on separate threads early in the app's start-up and so not guaranteed to be executed after `Bugsnag.start` has completed, or where Bugsnag may not have been started at all due to some internal app logic.
[slack-jallen](https://github.com/slack-jallen):[#1621](https://github.com/bugsnag/bugsnag-android/pull/1621)
[bugsnag-android#1640](https://github.com/bugsnag/bugsnag-android/pull/1640)
- Events and Sessions will be discarded if they cannot be uploaded and are older than 60 days or larger than 1MB
[bugsnag-android#1633](https://github.com/bugsnag/bugsnag-android/pull/1633)
- Fixed potentially [thread-unsafe access](https://github.com/bugsnag/bugsnag-android/issues/883) when invoking `Bugsnag` static methods across different threads whilst `Bugsnag.start` is still in-flight. It is now safe to call any `Bugsnag` static method once `Bugsnag.start` has _begun_ executing, as access to the client singleton is controlled by a lock, so the new `isStarted` method (see above) should only be required where it cannot be determined whether the call to `Bugsnag.start` has begun or you do not want to wait.
- [bugsnag-android#1638](https://github.com/bugsnag/bugsnag-android/pull/1638)
- Calling `bugsnag_event_set_context` with NULL `context` correctly clears the event context again
[bugsnag-android#1637](https://github.com/bugsnag/bugsnag-android/pull/1637)

### Fixed

- (plugin-express): send the request body (if present) as `event.request.body` rather than `event.metadata.request.body` [#1702](https://github.com/bugsnag/bugsnag-js/pull/1702)
- (plugin-restify): Include request body [#1701](https://github.com/bugsnag/bugsnag-js/pull/1701)

## v7.16.2 (2022-03-09)

### Fixed

Expand All @@ -10,7 +43,7 @@

- (plugin-react-navigation): Allow React Navigation v6 as a peer dependency [#1691](https://github.com/bugsnag/bugsnag-js/pull/1691)

### 7.16.1 (2022-02-02)
## 7.16.1 (2022-02-02)

### Fixed

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ services:
BROWSER_STACK_USERNAME:
BROWSER_STACK_ACCESS_KEY:
SKIP_NAVIGATION_SCENARIOS:
HERMES:
networks:
default:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.android-builder-base
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM openjdk:8-jdk-buster

# OS setup
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update && apt-get install -y gradle jq git-core build-essential openssl libssl-dev

# Android tools
Expand Down
9 changes: 9 additions & 0 deletions examples/ts/angular/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:8

WORKDIR /usr/src/app

COPY package* /usr/src/app/
RUN npm install

COPY . /usr/src/app/
CMD npm run serve -- --host 0.0.0.0
2 changes: 1 addition & 1 deletion examples/ts/angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ docker build -t bugsnag-js-example-angular . && \
docker run -p 4200:4200 -it bugsnag-js-example-angular
```

__Note__: remember to replace `YOUR_API_KEY` in `src/lib/bugsnag.js` with your own!
__Note__: remember to replace `YOUR_API_KEY` in `src/app/app.module.ts` with your own!

### Without docker
Ensure you have a version of Node.js >=4 on your machine.
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-express/src/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ module.exports = {
}

const getRequestAndMetadataFromReq = req => {
const requestInfo = extractRequestInfo(req)
const { body, ...requestInfo } = extractRequestInfo(req)
return {
metadata: requestInfo,
request: {
body,
clientIp: requestInfo.clientIp,
headers: requestInfo.headers,
httpMethod: requestInfo.httpMethod,
Expand Down
9 changes: 5 additions & 4 deletions packages/plugin-restify/src/restify.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module.exports = {
req.bugsnag = requestClient

// extract request info and pass it to the relevant bugsnag properties
const { request, metadata } = getRequestAndMetadataFromReq(req)
requestClient.addMetadata('request', metadata)
requestClient.addOnError((event) => {
const { request, metadata } = getRequestAndMetadataFromReq(req)
event.request = { ...event.request, ...request }
requestClient.addMetadata('request', metadata)
}, true)

if (!client._config.autoDetectErrors) return next()
Expand Down Expand Up @@ -77,15 +77,16 @@ module.exports = {
}

const getRequestAndMetadataFromReq = req => {
const requestInfo = extractRequestInfo(req)
const { body, ...requestInfo } = extractRequestInfo(req)
return {
metadata: requestInfo,
request: {
body,
clientIp: requestInfo.clientIp,
headers: requestInfo.headers,
httpMethod: requestInfo.httpMethod,
url: requestInfo.url,
referer: requestInfo.referer
referer: requestInfo.referer // Not part of the notifier spec for request but leaving for backwards compatibility
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
}

dependencies {
api "com.bugsnag:bugsnag-android:5.19.2"
api "com.bugsnag:bugsnag-plugin-react-native:5.19.2"
api "com.bugsnag:bugsnag-android:5.22.0"
api "com.bugsnag:bugsnag-plugin-react-native:5.22.0"
implementation 'com.facebook.react:react-native:+'

testImplementation "junit:junit:4.12"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/prepare-android-vendor.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version
5.19.2
5.22.0
2 changes: 1 addition & 1 deletion test/node/features/express.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ Scenario: adding body to request metadata
And the exception "message" equals "request body"
And the exception "type" equals "nodejs"
And the "file" of stack frame 0 equals "scenarios/app.js"
And the event "metaData.request.body.data" equals "in_request_body"
And the event "request.body.data" equals "in_request_body"
And the event "request.httpMethod" equals "POST"
6 changes: 6 additions & 0 deletions test/node/features/fixtures/restify/scenarios/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var server = restify.createServer()

server.pre(middleware.requestHandler)

server.use(restify.plugins.bodyParser());

// If the server hasn't started sending something within 2 seconds
// it probably won't. So end the request and hurry the failing test
// along.
Expand Down Expand Up @@ -79,6 +81,10 @@ server.get('/handled', function (req, res, next) {
res.end('OK')
})

server.post('/bodytest', function (req, res, next) {
throw new Error('request body')
})

server.on('restifyError', middleware.errorHandler)

server.listen(80)
13 changes: 13 additions & 0 deletions test/node/features/restify.feature
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,16 @@ Scenario: a handled error passed to req.bugsnag.notify()
And the event "request.url" equals "http://restify/handled"
And the event "request.httpMethod" equals "GET"
And the event "request.clientIp" is not null

Scenario: adding body to request metadata
When I POST the data "data=in_request_body" to the URL "http://restify/bodytest"
And I wait to receive an error
Then the error is valid for the error reporting API version "4" for the "Bugsnag Node" notifier
And the event "unhandled" is true
And the event "severity" equals "error"
And the exception "errorClass" equals "Error"
And the exception "message" equals "request body"
And the exception "type" equals "nodejs"
And the "file" of stack frame 0 equals "scenarios/app.js"
And the event "request.body.data" equals "in_request_body"
And the event "request.httpMethod" equals "POST"
48 changes: 46 additions & 2 deletions test/react-native-cli/features/fixtures/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ services:
aliases:
- maze-runner

rn0_63_expo_ejected:
build:
context: rn0_63_expo_ejected
dockerfile: ../Dockerfile
environment:
DEBUG:
networks:
default:
aliases:
- maze-runner

rn0_64:
build:
context: rn0_64
Expand All @@ -55,9 +66,42 @@ services:
aliases:
- maze-runner

rn0_63_expo_ejected:
rn0_65:
build:
context: rn0_63_expo_ejected
context: rn0_65
dockerfile: ../Dockerfile
environment:
DEBUG:
networks:
default:
aliases:
- maze-runner

rn0_66:
build:
context: rn0_66
dockerfile: ../Dockerfile
environment:
DEBUG:
networks:
default:
aliases:
- maze-runner

rn0_67:
build:
context: rn0_67
dockerfile: ../Dockerfile
environment:
DEBUG:
networks:
default:
aliases:
- maze-runner

rn0_67_hermes:
build:
context: rn0_67_hermes
dockerfile: ../Dockerfile
environment:
DEBUG:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4160098

Please sign in to comment.