From aecedde1de73b18c65c8ac5db2880ebdadf255f9 Mon Sep 17 00:00:00 2001 From: Chris Wendt Date: Fri, 24 Aug 2018 01:52:02 -0700 Subject: [PATCH] fix: a race condition was causing settings to be overwritten --- app/backend/extensions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/backend/extensions.ts b/app/backend/extensions.ts index 71bca7bd..38e4f08e 100644 --- a/app/backend/extensions.ts +++ b/app/backend/extensions.ts @@ -163,7 +163,11 @@ export function createExtensionsContextController( if (args.edit) { clientSettings = applyEdits( clientSettings, - setProperty(clientSettings, args.edit.path, args.edit.value, format) + // TODO(chris): remove `.slice()` (which guards against + // mutation) once + // https://github.com/Microsoft/node-jsonc-parser/pull/12 + // is merged in. + setProperty(clientSettings, args.edit.path.slice(), args.edit.value, format) ) } else if (typeof args.enabled === 'boolean') { clientSettings = applyEdits(