fix(base-driver): Make sure we never mutate incoming args
MODIFY
packages/base-driver/lib/basedriver/core.js
packages/base-driver/lib/basedriver/core.js
@@ -155,7 +155,7 @@ class DriverCore {
if (!this._log) {
const instanceName = `${this.constructor.name}@${node
.getObjectId(this)
- .substring(0, 8)}`;
+ .substring(0, 4)}`;
this._log = logger.getLogger(() =>
this.sessionId
? `${instanceName} (${this.sessionId.substring(0, 8)})`

MODIFY
packages/base-driver/lib/basedriver/driver.js
packages/base-driver/lib/basedriver/driver.js
@@ -233,11 +233,11 @@ export class BaseDriverCore extends DriverCore {
this.log.debug();
- const originalCaps = [
+ const originalCaps = _.cloneDeep([
w3cCapabilities,
w3cCapabilities1,
w3cCapabilities2,
- ].find(isW3cCaps);
+ ].find(isW3cCaps));
if (!originalCaps) {
throw new errors.SessionNotCreatedError(
'Appium only supports W3C-style capability objects. ' +

fix(base-driver): Make sure we never mutate incoming args (#16670)