Skip to content

Commit 42fe82b

Browse files
authored
Release 3.0.0-beta.5 (#1392)
1 parent 251fffb commit 42fe82b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+70334
-61299
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@
2222
- **Advanced search:** Filter items by many different properties. <a href="https://docs.rollbar.com/docs/search-items">Learn more about search</a>.
2323
- **Customizable notifications:** Rollbar supports several messaging and incident management tools where your team can get notified about errors and important events by real-time alerts. <a href="https://docs.rollbar.com/docs/notifications">Learn more about Rollbar notifications</a>.
2424

25+
## Session Replay (Beta)
26+
27+
**Important:** Session Replay is now available in beta! This feature captures and replays user sessions around errors, helping you understand exactly what happened before an error occurred. Replay can also be triggered based on custom conditions to capture critical user flows.
28+
29+
Because Session Replay includes additional recording capabilities, it uses a **separate, larger bundle**. If you want to use Session Replay, import from `rollbar/replay` instead of `rollbar`:
30+
31+
```javascript
32+
// Standard bundle (smaller, no replay)
33+
import Rollbar from 'rollbar';
34+
35+
// Session Replay bundle (includes replay capabilities)
36+
import Rollbar from 'rollbar/replay';
37+
```
38+
39+
Choose the standard bundle if you don't need replay functionality.
40+
41+
For Session Replay configuration and usage, see our [Session Replay documentation](https://docs.rollbar.com/docs/session-replay).
42+
2543
## Installation
2644

2745
Using npm:

dist/rollbar.cjs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ function merge() {
6161
copy,
6262
clone,
6363
name,
64-
result = {},
64+
result = Object.create(null),
65+
// no prototype pollution on Object
6566
current = null,
6667
length = arguments.length;
6768
for (i = 0; i < length; i++) {
@@ -671,6 +672,9 @@ function set(obj, path, value) {
671672
if (!obj) {
672673
return;
673674
}
675+
676+
// Prevent prototype pollution by setting the prototype to null.
677+
Object.setPrototypeOf(obj, null);
674678
var keys = path.split('.');
675679
var len = keys.length;
676680
if (len < 1) {
@@ -950,15 +954,15 @@ var Queue = /*#__PURE__*/function () {
950954
* `api.postItem(payload, function(err, response))`
951955
* @param logger - An object used to log verbose messages if desired
952956
* @param options - see `Queue.prototype.configure`
953-
* @param replayManager - Optional `ReplayManager` for coordinating session replay with error occurrences
957+
* @param replay - Optional `Replay` for coordinating session replay with error occurrences
954958
*/
955-
function Queue(rateLimiter, api, logger, options, replayManager) {
959+
function Queue(rateLimiter, api, logger, options, replay) {
956960
_classCallCheck(this, Queue);
957961
this.rateLimiter = rateLimiter;
958962
this.api = api;
959963
this.logger = logger;
960964
this.options = options;
961-
this.replayManager = replayManager;
965+
this.replay = replay;
962966
this.predicates = [];
963967
this.pendingItems = [];
964968
this.pendingRequests = [];
@@ -1047,8 +1051,8 @@ var Queue = /*#__PURE__*/function () {
10471051
callback(new Error('Transmit disabled'));
10481052
return;
10491053
}
1050-
if (this.replayManager && data.body) {
1051-
item.replayId = this.replayManager.capture(null, data.uuid, {
1054+
if (this.replay && data.body) {
1055+
item.replayId = this.replay.capture(null, data.uuid, {
10521056
type: 'occurrence',
10531057
level: item.level
10541058
});
@@ -1064,15 +1068,15 @@ var Queue = /*#__PURE__*/function () {
10641068
this._makeApiRequest(data, function (err, resp, headers) {
10651069
_this._dequeuePendingRequest(data);
10661070
if (item.replayId) {
1067-
_this.replayManager.sendOrDiscardReplay(item.replayId, err, resp, headers);
1071+
_this.replay.sendOrDiscardReplay(item.replayId, err, resp, headers);
10681072
}
10691073
callback(err, resp);
10701074
});
10711075
} catch (err) {
10721076
this._dequeuePendingRequest(data);
10731077
if (item.replayId) {
1074-
var _this$replayManager;
1075-
(_this$replayManager = this.replayManager) === null || _this$replayManager === void 0 || _this$replayManager.discard(item.replayId);
1078+
var _this$replay;
1079+
(_this$replay = this.replay) === null || _this$replay === void 0 || _this$replay.discard(item.replayId);
10761080
}
10771081
callback(err);
10781082
}
@@ -1390,13 +1394,13 @@ Notifier.prototype._applyTransforms = function (item, callback) {
13901394
* @param api
13911395
* @param logger
13921396
*/
1393-
function Rollbar(options, api, logger, telemeter, tracing, replayManager, platform) {
1397+
function Rollbar(options, api, logger, telemeter, tracing, replay, platform) {
13941398
this.options = src_merge(options);
13951399
this.logger = logger;
13961400
Rollbar.rateLimiter.configureGlobal(this.options);
13971401
Rollbar.rateLimiter.setPlatformOptions(platform, this.options);
13981402
this.api = api;
1399-
this.queue = new queue(Rollbar.rateLimiter, api, logger, this.options, replayManager);
1403+
this.queue = new queue(Rollbar.rateLimiter, api, logger, this.options, replay);
14001404
this.tracing = tracing;
14011405

14021406
// Legacy OpenTracing support
@@ -1982,7 +1986,7 @@ var logger = {
19821986
/**
19831987
* Default options shared across platforms
19841988
*/
1985-
var version = '3.0.0-beta.4';
1989+
var version = '3.0.0-beta.5';
19861990
var endpoint = 'api.rollbar.com/api/1/item/';
19871991
var logLevel = 'debug';
19881992
var reportLevel = 'debug';

0 commit comments

Comments
 (0)