From 743c8406c973af7ef85ff31ea8bb0bc99d4592fb Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Fri, 28 Jun 2019 15:09:46 -0700 Subject: [PATCH] fix: When reporting initial config, avoid creating a "VPN enabled" unnecessary override Since we were comparing the VPN's value before adding the explicit "true", there were cases were the VPN is off, and therefore "value" didn't match the default, so the supervisor would create a device specific SUPERVISOR_VPN_CONTROL = true, which is unnecessary and causes issues if users don't expect this and move the device to an app that has VPN disabled. The correct behavior is to compare "varValue" and only create a device config var if this value differs from the default. (This was the behavior before the TS conversion in 01ed7bb103b4df8fb0679cf858220db42d4a0b92 ) Change-type: patch Signed-off-by: Pablo Carranza Velez --- src/api-binder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api-binder.ts b/src/api-binder.ts index f5940c75..be6e8da8 100644 --- a/src/api-binder.ts +++ b/src/api-binder.ts @@ -708,7 +708,7 @@ export class APIBinder { varValue = 'true'; } - if (targetConfig[key] == null && value !== defaultConfig[key]) { + if (targetConfig[key] == null && varValue !== defaultConfig[key]) { const envVar = { value: varValue, device: deviceId,