Skip to content

Commit

Permalink
Always specify DeviceInfo.deviceType
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Sep 11, 2024
1 parent 4cbaf8f commit 931f473
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion proto/deviceInfo/v1.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ message DeviceInfo_1 {
}

string name = 5 [(required) = true];
optional DeviceType deviceType = 6;
DeviceType deviceType = 6;
}
1 change: 1 addition & 0 deletions src/lib/encode-conversions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const convertDeviceInfo: ConvertFunction<'deviceInfo'> = (mapeoDoc) => {
return {
common: convertCommon(mapeoDoc),
...mapeoDoc,
deviceType: mapeoDoc.deviceType ?? 'device_type_unspecified',
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/good-docs-minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const goodDocsMinimal = [
name: 'my device name',
deleted: false,
},
expected: {},
expected: { deviceType: 'device_type_unspecified' },
},
{
doc: {
Expand Down

0 comments on commit 931f473

Please sign in to comment.