From 49eca4affee066dfa3eb5bcb36878370a27e8fb5 Mon Sep 17 00:00:00 2001 From: djskinner Date: Fri, 14 Jul 2023 10:23:05 +0100 Subject: [PATCH] Update UPGRADING.md --- UPGRADING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 983252c1e4..78b69d9e64 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -13,7 +13,7 @@ The minimum supported node version is now v12.17.0. When using `plugin-express`, `plugin-koa`, `plugin-restify`, or `plugin-contextualize` a clone of the top-level Bugsnag client is made so that any subsequent changes made to the client (such as attaching metadata) only affect the scope of a particular context (a request in the case of the web server plugins, and a function call in the case of `plugin-contextualize`). -Prior to v8 calls made to the top-level `Bugsnag` static interface were not aware of this context so users had to ensure they were calling methods on the correct client instance, i.e. that attached to `req.bugsnag` (or `ctx.bugsnag` for koa). This isn't ideal because if you wanted to call notify in some function deep in a call stack you would have to pass `req.bugsnag` all the way down, as calling `Bugsnag.notify` would not have contained the request metadata gathered by the plugin. With version 8 of the notifier, top-level calls to `Bugsnag` are now context-aware. This means you can call `Bugsnag.notify` (or `Bugsnag.leaveBreadcrumb` etc.), and, if it was called within a context, the call will be forwarded to the correct cloned version of that client (i.e. for the particular request from which the call originated). +Prior to v8, calls made to the top-level `Bugsnag` static interface were not aware of this context so users had to ensure they were calling methods on the correct client instance, i.e. the cloned client that was made available on `req.bugsnag` (or `ctx.bugsnag` for koa). This wasn't ideal because if you wanted to interact with Bugsnag in some function deep in a call stack you would have to pass `req.bugsnag` all the way down, as calling `Bugsnag.notify` would not have contained the request metadata gathered by the plugin. With version 8 of the notifier top-level calls to `Bugsnag` are now context-aware. This means you can call `Bugsnag.notify` (or `Bugsnag.leaveBreadcrumb` etc.), and, if it was called within a context, the call will be forwarded to the correct cloned version of that client (i.e. for the particular request from which the call originated). Express @@ -38,7 +38,7 @@ app.use(async (ctx, next) => { }) ``` -Note: `req.bugsnag` (and `ctx.bugsnag` in koa) is still present in v8 but marked as deprecated, and may be removed in a later version. +Note: `req.bugsnag` (and `ctx.bugsnag` in koa) is still present in v8. #### breadcrumb support