mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-24 04:55:42 +00:00
Do not send name as part of the current state
This fixes a race condition that could occur with the first current state report, where if the device managed to send the current state report first, then the device name on the cloud would be set to `local` (see #1959). Closes: #1959 Change-type: patch
This commit is contained in:
parent
888ffa700d
commit
99efd12acd
@ -481,11 +481,7 @@ export async function setTarget(target: TargetState, localSource?: boolean) {
|
||||
|
||||
globalEventBus.getInstance().emit('targetStateChanged', target);
|
||||
|
||||
const { uuid, apiEndpoint } = await config.getMany([
|
||||
'uuid',
|
||||
'apiEndpoint',
|
||||
'name',
|
||||
]);
|
||||
const { uuid, apiEndpoint } = await config.getMany(['uuid', 'apiEndpoint']);
|
||||
|
||||
if (!uuid || !target[uuid]) {
|
||||
throw new Error(
|
||||
@ -625,11 +621,7 @@ export async function getCurrentForReport(
|
||||
{} as { [appUuid: string]: AppState },
|
||||
);
|
||||
|
||||
const { name, uuid, localMode } = await config.getMany([
|
||||
'name',
|
||||
'uuid',
|
||||
'localMode',
|
||||
]);
|
||||
const { uuid, localMode } = await config.getMany(['uuid', 'localMode']);
|
||||
|
||||
if (!uuid) {
|
||||
throw new InternalInconsistencyError('No uuid found for local device');
|
||||
@ -649,7 +641,6 @@ export async function getCurrentForReport(
|
||||
{
|
||||
...currentVolatile,
|
||||
...systemInfo,
|
||||
name,
|
||||
apps: appsForReport,
|
||||
},
|
||||
(__, key) => omitFromReport.includes(key),
|
||||
|
Loading…
x
Reference in New Issue
Block a user