mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-05 05:24:12 +00:00
Avoid double omit
s whilst filtering current state
Change-type: patch
This commit is contained in:
parent
9a3596c44c
commit
466ff58871
@ -108,18 +108,18 @@ const getStateDiff = (): DeviceStatus => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const diff = {
|
const diff = {
|
||||||
local: _(stateForReport.local)
|
local: _.omitBy(
|
||||||
.omitBy((val, key: keyof DeviceStatus['local']) =>
|
stateForReport.local,
|
||||||
|
(val, key: keyof NonNullable<DeviceStatus['local']>) =>
|
||||||
|
INTERNAL_STATE_KEYS.includes(key) ||
|
||||||
_.isEqual(lastReportedLocal[key], val),
|
_.isEqual(lastReportedLocal[key], val),
|
||||||
)
|
),
|
||||||
.omit(INTERNAL_STATE_KEYS)
|
dependent: _.omitBy(
|
||||||
.value(),
|
stateForReport.dependent,
|
||||||
dependent: _(stateForReport.dependent)
|
(val, key: keyof DeviceStatus['dependent']) =>
|
||||||
.omitBy((val, key: keyof DeviceStatus['dependent']) =>
|
INTERNAL_STATE_KEYS.includes(key) ||
|
||||||
_.isEqual(lastReportedDependent[key], val),
|
_.isEqual(lastReportedDependent[key], val),
|
||||||
)
|
),
|
||||||
.omit(INTERNAL_STATE_KEYS)
|
|
||||||
.value(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const toOmit: string[] = sysInfo.filterNonSignificantChanges(
|
const toOmit: string[] = sysInfo.filterNonSignificantChanges(
|
||||||
|
@ -40,7 +40,9 @@ export interface DeviceStatus {
|
|||||||
};
|
};
|
||||||
} & DeviceReportFields;
|
} & DeviceReportFields;
|
||||||
// TODO: Type the dependent entry correctly
|
// TODO: Type the dependent entry correctly
|
||||||
dependent?: any;
|
dependent?: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
commit?: string;
|
commit?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user