mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-03 12:34:11 +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 = {
|
||||
local: _(stateForReport.local)
|
||||
.omitBy((val, key: keyof DeviceStatus['local']) =>
|
||||
local: _.omitBy(
|
||||
stateForReport.local,
|
||||
(val, key: keyof NonNullable<DeviceStatus['local']>) =>
|
||||
INTERNAL_STATE_KEYS.includes(key) ||
|
||||
_.isEqual(lastReportedLocal[key], val),
|
||||
)
|
||||
.omit(INTERNAL_STATE_KEYS)
|
||||
.value(),
|
||||
dependent: _(stateForReport.dependent)
|
||||
.omitBy((val, key: keyof DeviceStatus['dependent']) =>
|
||||
),
|
||||
dependent: _.omitBy(
|
||||
stateForReport.dependent,
|
||||
(val, key: keyof DeviceStatus['dependent']) =>
|
||||
INTERNAL_STATE_KEYS.includes(key) ||
|
||||
_.isEqual(lastReportedDependent[key], val),
|
||||
)
|
||||
.omit(INTERNAL_STATE_KEYS)
|
||||
.value(),
|
||||
),
|
||||
};
|
||||
|
||||
const toOmit: string[] = sysInfo.filterNonSignificantChanges(
|
||||
|
@ -40,7 +40,9 @@ export interface DeviceStatus {
|
||||
};
|
||||
} & DeviceReportFields;
|
||||
// TODO: Type the dependent entry correctly
|
||||
dependent?: any;
|
||||
dependent?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
commit?: string;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user