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:
Sameh Khamis committed 2026-11-10 18:12:53 -08:00
1 parent 57ff81f723
commit cbbf55cacd
74 files changed
+2481 -586

No files matched your search

+8 -3
View File
@@ -65,7 +65,12 @@ export function resolveEntryKind() {
export function dispatchCockpitModeChanged(active, info = null) {
const subjectId = active
? String(info?.icao24 || info?.mmsi || info?.noradId || '')
? String(
info?.icao24 ||
(info?.kind === 'vessel' ? info.id : '') ||
info?.noradId ||
'',
)
.trim()
.toLowerCase() || null
: null;
@@ -245,7 +250,7 @@ export function enter({ kind = null } = {}) {
// Each session reads its own water: never a height left from the last.
this.vesselWaterline = null;
this.vesselFix = null;
this.subjectId = vessel ? info.mmsi : satellite ? info.noradId : null;
this.subjectId = vessel ? info.id : satellite ? info.noradId : null;
this.trackedEntity = entity;
if (entity) {
this.trackedEntityWasShown = entity.show;
@@ -255,7 +260,7 @@ export function enter({ kind = null } = {}) {
this.services.satellitesLayer?.setCockpitSubject?.(info.noradId);
this.beginOrbital();
} else {
this.services.aisLiveVesselsLayer?.setCockpitSubject?.(info.mmsi);
this.services.aisLiveVesselsLayer?.setCockpitSubject?.(info.id);
}
// A ship reporting neither heading nor course keeps the camera's own
// heading: no direction is made up for it.