mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
feat(vessels): key vessels by their source's stable id, and share a selected vessel
AIS Vessels are keyed by the id their live source gives, with the MMSI as an attribute: an MMSI can be shared, spoofed or reused, so two vessels with one MMSI are now two vessels. Looking a vessel up or selecting it by MMSI still finds it. A share link made while a vessel is selected opens that vessel. A UUID vessel id travels as 16 bytes in a new thing field (13). A shared thing that is not reporting now says so in a sentence per kind, with its id (ICAO, NORAD, MMSI or vessel UUID) on a second line.
This commit is contained in:
1 parent
57ff81f723
commit
cbbf55cacd
74 files changed
+2481
-586
No files matched your search
@@ -245,6 +245,31 @@ test('P2-7: duplicate callsigns and names resolve by canonical identity', () =>
|
||||
);
|
||||
});
|
||||
|
||||
test('vessels sharing an MMSI resolve by their vessel id', () => {
|
||||
const referents = createReferentRegistry();
|
||||
referents.recordResult('analyst_query', {
|
||||
ok: true,
|
||||
items: ['hull-a', 'hull-b'].map((vesselId) => ({
|
||||
layerKey: 'ais-live-vessels',
|
||||
id: 'EVER GIVEN',
|
||||
vesselId,
|
||||
mmsi: '353136000',
|
||||
name: 'EVER GIVEN',
|
||||
})),
|
||||
});
|
||||
assert.deepEqual(
|
||||
[1, 2].map(
|
||||
(n) =>
|
||||
resolveDeicticArgs(
|
||||
'track_entity',
|
||||
{ query: 'x', referent: n },
|
||||
{ referents },
|
||||
).args.query,
|
||||
),
|
||||
['hull-a', 'hull-b'],
|
||||
);
|
||||
});
|
||||
|
||||
test('P1-1: a result from before the last clear cannot repopulate the registry', () => {
|
||||
const referents = createReferentRegistry();
|
||||
const since = referents.generation();
|
||||
|
||||
Reference in new issue
Block a user