signalk-wakelogger 0.2.0-beta.5 → 0.2.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +13 -3
- package/dist/config/defaults.d.ts +1 -0
- package/dist/config/defaults.js +2 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.js +8 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/courses/native-course.js +6 -0
- package/dist/courses/native-course.js.map +1 -1
- package/dist/courses/protocol.d.ts +1 -0
- package/dist/courses/protocol.js +5 -0
- package/dist/courses/protocol.js.map +1 -1
- package/dist/index.js +647 -10
- package/dist/index.js.map +1 -1
- package/dist/outbox/database-outbox.js +13 -0
- package/dist/outbox/database-outbox.js.map +1 -1
- package/dist/race/averages.d.ts +12 -0
- package/dist/race/averages.js +44 -0
- package/dist/race/averages.js.map +1 -0
- package/dist/race/detection.d.ts +65 -0
- package/dist/race/detection.js +150 -0
- package/dist/race/detection.js.map +1 -0
- package/dist/race/dynamic.d.ts +114 -0
- package/dist/race/dynamic.js +265 -0
- package/dist/race/dynamic.js.map +1 -0
- package/dist/race/navigation-control.d.ts +23 -0
- package/dist/race/navigation-control.js +63 -0
- package/dist/race/navigation-control.js.map +1 -0
- package/dist/race/observation-window.d.ts +81 -0
- package/dist/race/observation-window.js +198 -0
- package/dist/race/observation-window.js.map +1 -0
- package/dist/race/observations.d.ts +54 -0
- package/dist/race/observations.js +212 -0
- package/dist/race/observations.js.map +1 -0
- package/dist/race/onboard-service.d.ts +58 -0
- package/dist/race/onboard-service.js +232 -0
- package/dist/race/onboard-service.js.map +1 -0
- package/dist/race/onboard-store.d.ts +66 -0
- package/dist/race/onboard-store.js +141 -0
- package/dist/race/onboard-store.js.map +1 -0
- package/dist/race/pack.d.ts +126 -0
- package/dist/race/pack.js +317 -0
- package/dist/race/pack.js.map +1 -0
- package/dist/race/plan.d.ts +21 -0
- package/dist/race/plan.js +45 -0
- package/dist/race/plan.js.map +1 -0
- package/dist/race/progression-service.d.ts +33 -0
- package/dist/race/progression-service.js +84 -0
- package/dist/race/progression-service.js.map +1 -0
- package/dist/race/progression-store.d.ts +27 -0
- package/dist/race/progression-store.js +90 -0
- package/dist/race/progression-store.js.map +1 -0
- package/dist/race/race-pack-protocol.d.ts +114 -0
- package/dist/race/race-pack-protocol.js +463 -0
- package/dist/race/race-pack-protocol.js.map +1 -0
- package/dist/race/race-pack-store.d.ts +34 -0
- package/dist/race/race-pack-store.js +181 -0
- package/dist/race/race-pack-store.js.map +1 -0
- package/dist/race/readiness.d.ts +73 -0
- package/dist/race/readiness.js +108 -0
- package/dist/race/readiness.js.map +1 -0
- package/dist/race/sailing/physics.d.ts +86 -0
- package/dist/race/sailing/physics.js +254 -0
- package/dist/race/sailing/physics.js.map +1 -0
- package/dist/race/sailing/selection.d.ts +109 -0
- package/dist/race/sailing/selection.js +452 -0
- package/dist/race/sailing/selection.js.map +1 -0
- package/dist/signalk/normaliser.d.ts +6 -0
- package/dist/signalk/normaliser.js +19 -1
- package/dist/signalk/normaliser.js.map +1 -1
- package/dist/signalk/subscriber.js +3 -1
- package/dist/signalk/subscriber.js.map +1 -1
- package/dist/telemetry/types.d.ts +10 -0
- package/dist/tracking/archive.d.ts +62 -0
- package/dist/tracking/archive.js +479 -0
- package/dist/tracking/archive.js.map +1 -0
- package/dist/tracking/track.d.ts +20 -0
- package/dist/tracking/track.js +25 -0
- package/dist/tracking/track.js.map +1 -0
- package/dist/transport/mqtt-client.d.ts +16 -2
- package/dist/transport/mqtt-client.js +80 -6
- package/dist/transport/mqtt-client.js.map +1 -1
- package/dist/transport/topics.d.ts +3 -0
- package/dist/transport/topics.js +3 -1
- package/dist/transport/topics.js.map +1 -1
- package/docs/course-sync.md +86 -5
- package/docs/onboard-race-guidance.md +622 -0
- package/docs/race-pack-schema.md +315 -0
- package/package.json +10 -6
- package/public/api-client.mjs +161 -12
- package/public/app.mjs +618 -46
- package/public/index.html +5 -4
- package/public/instruments.mjs +215 -0
- package/public/navigation-errors.mjs +38 -0
- package/public/offline-readiness.mjs +24 -0
- package/public/race-plan.mjs +96 -0
- package/public/style.css +2 -0
- package/public/track.mjs +87 -0
- package/public/tracking-controls.mjs +18 -4
- package/public/wind-derivation.mjs +58 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,76 @@
|
|
|
2
2
|
|
|
3
3
|
Updates for boat owners and crew: what's new, what's improved, and anything you need to do.
|
|
4
4
|
|
|
5
|
+
## [0.2.0-beta.7] - 2026-10-01
|
|
6
|
+
|
|
7
|
+
### A new recording never shows the previous trip
|
|
8
|
+
|
|
9
|
+
- If a fresh recording starts (or the boat records before a browser connects), the onboard map no longer treats a browser-drawn tail as the whole trip: an empty or failed archive read is reconciled on the next poll, so the full recovered track appears promptly instead of after hundreds of fixes.
|
|
10
|
+
- The map keeps an explicit viewport intent. Fullscreen, rotation, resizing and course changes no longer re-frame the map or drop the selected recording, the archive identity is guarded so a delayed response for a previous recording cannot appear, and a new recording's positions are never appended to the recording still on screen. Fit course, Fit track and Centre on vessel stay separate.
|
|
11
|
+
|
|
12
|
+
### See the whole trip from wherever you open the map
|
|
13
|
+
|
|
14
|
+
- Opening the onboard map part-way through a passage (or reloading, or connecting a second device) now shows the recorded track from the real departure through the latest position, sourced from the durable onboard archive rather than from page-open time. This works with no internet and with Live tracking off, and it survives a plugin restart without its graceful stop path.
|
|
15
|
+
- A labelled **Fit track** control fits the whole sailed track, independent of any course, and the map automatically fits the full track on first load unless you have already panned or zoomed. Fit course and Centre on vessel stay separate, so course overlays never hide the sailed history.
|
|
16
|
+
|
|
17
|
+
### Completed trips stay on the map after upload
|
|
18
|
+
|
|
19
|
+
- The onboard map archive keeps its own recording index, independent of the upload queue. A completed trip remains available on the map after its telemetry has been uploaded and acknowledged and after the pending-upload records are removed, and it survives a reload or plugin restart. Starting a new trip never mixes it with the previous one.
|
|
20
|
+
- The archive repairs an interrupted write when it next opens or appends: a partial header is rewritten, a partial final record is trimmed, and a corrupt file is quarantined, so records stay aligned. Writes are ordered and bounded, and pending writes are flushed on orderly shutdown. Power-loss durability is not claimed per sample; the last flushed data is retained and the tail is repaired.
|
|
21
|
+
|
|
22
|
+
### Navigation can only be advanced by the controlling device
|
|
23
|
+
|
|
24
|
+
- Taking navigation control returns a generation. A permit from the plugin is an authorisation, not an application: `already_applied`/`superseded` are reported only from observed native state, the actual pending detection is validated, and the detection is accepted only after a confirm step re-reads native state. A stale point, changed course, expired/handed-over controller, or missing detection is rejected, and a merely permitted-but-unexecuted attempt stays pending and retryable.
|
|
25
|
+
- Automatic application is disabled in this candidate, because Signal K 2.31 has no plugin point-index API or compare-and-set to fence a client-performed native write. Detections are offered for explicit acceptance by the controlling device. Each browser tab has its own identity, so a newly opened tab is a viewer until someone deliberately takes control.
|
|
26
|
+
|
|
27
|
+
### Trustworthy instrument values
|
|
28
|
+
|
|
29
|
+
- Every input used by a derived wind or VMG value — including speed over ground/through water and the heading used to convert an apparent angle — now participates in the freshness and time-skew bound, so a stale input cannot be hidden by a fresh one.
|
|
30
|
+
- Signal K request deadlines now stay active while the response body is being read, so a stalled body times out instead of hanging, and the next poll recovers.
|
|
31
|
+
|
|
32
|
+
### A broken source clock can no longer hide the trip
|
|
33
|
+
|
|
34
|
+
- A source time more than 30 days before the delta was delivered is treated as a broken clock and replaced by receipt time, instead of being queued and later rejected by Wake Logger as outside the vessel's entitled capture window (for example a GPS reporting a stale 2014 default date).
|
|
35
|
+
- The database outbox now declares sequences skipped by a seed or reset as dropped when it opens, matching the file outbox, so the cloud's contiguous acknowledgement can advance and later trips are not left waiting for history.
|
|
36
|
+
|
|
37
|
+
## [Unreleased] - 2026-09-27
|
|
38
|
+
|
|
39
|
+
### Offline race readiness you can trust
|
|
40
|
+
|
|
41
|
+
- One clear **Offline race ready** status now checks that the selected course is applied, the expected Signal K route is active, and a Race Pack that matches the course (id, race plan and course definition) is prepared with supported rules and a current forecast. Changing the course immediately invalidates readiness for the old pack, even though that pack is kept for history.
|
|
42
|
+
- Switching Live tracking off stays possible for radio silence, but if readiness is incomplete the app now shows a prominent pre-switch warning that names exactly what is missing instead of implying onboard sail planning will work.
|
|
43
|
+
|
|
44
|
+
### Clearer navigation failures
|
|
45
|
+
|
|
46
|
+
- Failed Signal K requests now keep the operation, method, path, HTTP status and a bounded, credential-safe reason. Advancing, setting or activating a course shows a human-readable message such as "Could not advance to the next course point to Mark 3 — Signal K rejected the active route update: <reason>", and the bounded detail is written to the plugin log. Tokens and passwords are never logged or displayed.
|
|
47
|
+
|
|
48
|
+
### A track that survives reload
|
|
49
|
+
|
|
50
|
+
- The onboard map now rebuilds the current recording's track from an independent durable onboard archive on open or reload, rather than starting at page-open time and rather than depending on whether telemetry has already been uploaded. New fixes append incrementally; long trips are decimated for display without changing the recording; and the complete geometry survives browser reload, page-resume and plugin restart with no Wake Logger/cloud connection. A tail-only cloud trip is marked "Reconstructing trip · N% history received" until its history converges.
|
|
51
|
+
|
|
52
|
+
### Standalone vessel instruments
|
|
53
|
+
|
|
54
|
+
- A new **Instruments** tab is the default when no course is selected. It reads position, speed and course over ground, heading (true or magnetic), speed through water, depth (with its reference), and apparent and true wind directly from the local Signal K server.
|
|
55
|
+
- Instruments are independent of the course, Race Pack, recording and Wake Logger connection: a failed course request, a mismatched pack or Live tracking off does not stop them. Freshness is tracked per measurement, stale and missing values are marked, and no wind is invented from forecast data. Wind-relative VMG is labelled as such.
|
|
56
|
+
- "No course selected" is a normal state: the instrument view stays clean, and course controls and race warnings remain in the race panel.
|
|
57
|
+
|
|
58
|
+
## [0.2.0-beta.6] - 2026-09-26
|
|
59
|
+
|
|
60
|
+
### Onboard race planning matches Wake Logger exactly
|
|
61
|
+
|
|
62
|
+
- The onboard planner now starts the current leg from your boat's actual position, uses the real current in its speed and arrival estimates, and no longer assumes a fixed six-knot midpoint speed. Remaining distance and arrival times reflect where you actually are.
|
|
63
|
+
- Onboard wind is only used for the current leg once a genuine five-minute observation window is ready (30 good samples across at least four minutes, newest within 30 seconds). Until then the downloaded forecast is used, with a clear note.
|
|
64
|
+
- A downloaded course is only used when its course definition matches the Race Pack, so an edited course can't be planned against an old pack. Reversed courses are not planned rather than being calculated the wrong way round.
|
|
65
|
+
- Wake Logger cloud now calculates the remaining race with exactly the same rules as the onboard planner, so the two agree. Raw instrument samples are aggregated with the same method on both sides, and the Live tracking ON and OFF views show the same plan and sail recommendation.
|
|
66
|
+
|
|
67
|
+
### Reliable Race Pack and race-plan hand-over
|
|
68
|
+
|
|
69
|
+
- A removed or archived course now clears the onboard Race Pack durably, so a stale copy can't reappear after a restart or reconnect.
|
|
70
|
+
- Onboard race-plan updates are only removed once Wake Logger confirms it stored them; if the confirmation is missed they are sent again after reconnecting or restarting.
|
|
71
|
+
- Onboard race-plan updates now carry the recording session they came from, so Wake Logger links them to the right outing even when they arrive late.
|
|
72
|
+
- Switching Live tracking off sends one final onboard status and then stops transmitting immediately. The final onboard status is kept by the server after the plugin disconnects, and an unexpected connection loss still reports the vessel offline.
|
|
73
|
+
- Added a production-like broker test (`npm run test:broker:dynsec`) that runs against a real Mosquitto dynamic-security broker and the Wake Logger cloud provisioning/framing functions.
|
|
74
|
+
|
|
5
75
|
## [0.2.0-beta.5] - 2026-09-16
|
|
6
76
|
|
|
7
77
|
### Live tracking when you want it
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ You can also choose **Record locally** or **Automatic upload** in the plugin's *
|
|
|
45
45
|
|
|
46
46
|
On reconnecting, the latest position is sent promptly while stored history uploads in the background. With the supporting Wake Logger service update, your vessel view shows the percentage of stored history uploaded and an estimated time remaining once there is enough upload progress to measure. Estimates pause when the connection is lost. Detailed recording updates are available under **Upload details**. Wake Logger uses the recorded movement and times to identify trips; switching live tracking does not itself create a new trip. Missing or rejected readings are flagged rather than presented as a complete trip.
|
|
47
47
|
|
|
48
|
-
**Before a long outing:** Check available storage and your queue limits. The default limits are seven days or 250 MB, whichever is reached first. If a limit is reached, the oldest queued readings are discarded; plugin status reports the dropped count. Recording locally controls this plugin's Wake Logger connections only—it does not switch off other apps or your boat's internet access.
|
|
48
|
+
**Before a long outing:** Check available storage and your queue limits. The default limits are seven days or 250 MB, whichever is reached first. If a limit is reached, the oldest queued readings are discarded; plugin status reports the dropped count. The dropped count is a **lifetime** total across every upload, not the number lost from the current trip—losses that belong to the current upload are shown separately, and a recording affected by them is marked as not complete. Recording locally controls this plugin's Wake Logger connections only—it does not switch off other apps or your boat's internet access.
|
|
49
49
|
|
|
50
50
|
## Bring your race course onboard
|
|
51
51
|
|
|
@@ -53,12 +53,22 @@ Select a saved race course for your vessel in Wake Logger while internet access
|
|
|
53
53
|
|
|
54
54
|
Open the **Wake Logger webapp** from Signal K's Web Apps list, using a phone, tablet or computer connected to the boat's network. Sign in to Signal K if prompted. Any Signal K user account can view the onboard map; changing live tracking or activating a course requires an account with read/write access.
|
|
55
55
|
|
|
56
|
-
The onboard map uses the same instrument styling as Wake Logger's live view, adapts to phone and tablet screens, and includes a full-screen view. It shows the complete course, your boat, the next mark and current leg. Distance, bearing, cross-track error, VMG and arrival estimates appear when Signal K can calculate them; unavailable readings are left clearly marked.
|
|
56
|
+
The onboard map uses the same instrument styling as Wake Logger's live view, adapts to phone and tablet screens, and includes a full-screen view. It shows the complete course, your boat, the next mark and current leg. Distance, bearing, cross-track error, VMG and arrival estimates appear when Signal K can calculate them; unavailable readings are left clearly marked. Your recorded track is loaded from durable onboard storage when the page opens and then updated live, so reloading the app mid-passage still shows the whole trip rather than only the track since the page opened.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Alongside the map, the webapp shows an **onboard race plan**. While **Live tracking** is on, Wake Logger cloud calculates the remaining race: it starts the current leg from your boat's actual position, samples the downloaded forecast at each leg's estimated time, and accounts for current, so the suggested heading, sail plan and arrival estimate keep up with how the race is actually going. When **Live tracking** is off, the vessel performs the same calculation on board from the Race Pack synchronised before departure, so the plan is still available with no internet access. If no Race Pack has synchronised yet, the map and course still work and the plan is clearly marked as unavailable.
|
|
59
|
+
|
|
60
|
+
Use **Advance point** to move to the next course point, or select a point and choose **Set point** to correct your progress. When mark detection is set to Automatic, a detected rounding advances only on the device that has explicitly taken **Navigation control**; other phones or tablets stay viewers and never advance the course. Detection suggests or holds when it is unsure, and manual controls always win.
|
|
59
61
|
|
|
60
62
|
Your course is also available as a standard Signal K route for other onboard applications. If another app selects a different active route, Wake Logger shows that state. Choose **Activate Wake Logger course** when you want to return to it.
|
|
61
63
|
|
|
64
|
+
Before going offshore, check the onboard app's status. **Offline race ready** means the selected course has been applied, its Signal K route is active (and not reversed), a Race Pack that matches the course is stored with supported rules and a forecast valid now, and onboard sail planning will work with no internet. The app distinguishes a forecast that is merely valid now from one whose declared coverage spans the expected race window, and says so when it cannot confirm the whole window. If anything is missing the app says so; you can still switch Live tracking off for radio silence, but you will see a warning naming what is missing.
|
|
65
|
+
|
|
66
|
+
## Watch your instruments with no course and no internet
|
|
67
|
+
|
|
68
|
+
Open the **Wake Logger webapp** and choose the **Instruments** tab (the default when no course is selected). It reads directly from your boat's Signal K server and shows position, speed and course over ground, heading (true or magnetic), speed through water, depth (with its stated reference), and apparent and true wind, with units and a clear measured/derived label.
|
|
69
|
+
|
|
70
|
+
Instrument readings are independent of the course, Race Pack, recording and cloud connection. Each reading tracks its own freshness, so a stale sensor is marked with its age while the others stay live, and a missing value is shown as unavailable rather than guessed. Wind-relative VMG is labelled separately from VMG to a waypoint (ground- and water-referenced where available). Viewing instruments on another phone or tablet is read-only by default: it will not activate a course, advance a mark, change upload mode or start a recording.
|
|
71
|
+
|
|
62
72
|
## Prepare your map for offline use
|
|
63
73
|
|
|
64
74
|
The onboard map can show your boat and course without internet access. Basemap coverage needs a little preparation:
|
package/dist/config/defaults.js
CHANGED
|
@@ -22,7 +22,8 @@ function parseConfig(value) {
|
|
|
22
22
|
samplePeriodMs: boundedNumber(input.samplePeriodMs, exports.DEFAULTS.samplePeriodMs, 250, 60_000),
|
|
23
23
|
maxOutboxMb: boundedNumber(input.maxOutboxMb, 250, 10, 4096),
|
|
24
24
|
maxOutboxDays: boundedNumber(input.maxOutboxDays, 7, 1, 30),
|
|
25
|
-
debugTelemetry: input.debugTelemetry === true
|
|
25
|
+
debugTelemetry: input.debugTelemetry === true,
|
|
26
|
+
raceProgressionMode: input.raceProgressionMode === 'suggest' || input.raceProgressionMode === 'off' ? input.raceProgressionMode : 'auto'
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
function boundedNumber(value, fallback, min, max) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":";;;AAqBA,kCAeC;AApCY,QAAA,QAAQ,GAAG;IACtB,aAAa,EAAE,gDAAgD;IAC/D,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,EAAE;IACb,eAAe,EAAE,EAAE,GAAG,IAAI;IAC1B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACjC,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACvC,YAAY,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;CACrB,CAAA;AAaV,SAAgB,WAAW,CAAC,KAAa;IACvC,MAAM,KAAK,GAAG,KAAgC,CAAA;IAC9C,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW;QAC1E,WAAW,EAAE,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;QACrH,aAAa,EACX,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAChF,CAAC,CAAC,KAAK,CAAC,aAAa;YACrB,CAAC,CAAC,gBAAQ,CAAC,aAAa;QAC5B,cAAc,EAAE,aAAa,CAAC,KAAK,CAAC,cAAc,EAAE,gBAAQ,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC;QACzF,WAAW,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC;QAC5D,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3D,cAAc,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI;QAC7C,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,KAAK,SAAS,IAAI,KAAK,CAAC,mBAAmB,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM;KACzI,CAAA;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAAc,EAAE,QAAgB,EAAE,GAAW,EAAE,GAAW;IAC/E,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAA;AAC/G,CAAC"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -47,5 +47,13 @@ export declare const configSchema: {
|
|
|
47
47
|
readonly title: "Enable telemetry debug logging";
|
|
48
48
|
readonly default: false;
|
|
49
49
|
};
|
|
50
|
+
readonly raceProgressionMode: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly title: "Mark detection mode";
|
|
53
|
+
readonly enum: readonly ["auto", "suggest", "off"];
|
|
54
|
+
readonly enumNames: readonly ["Automatic", "Suggest", "Off"];
|
|
55
|
+
readonly default: "auto";
|
|
56
|
+
readonly description: "Automatic advances the active course point when the onboard app detects a rounding, start or finish; it also records evidence for Wake Logger. Suggest asks the crew first. Off records evidence only.";
|
|
57
|
+
};
|
|
50
58
|
};
|
|
51
59
|
};
|
package/dist/config/schema.js
CHANGED
|
@@ -49,6 +49,14 @@ exports.configSchema = {
|
|
|
49
49
|
type: 'boolean',
|
|
50
50
|
title: 'Enable telemetry debug logging',
|
|
51
51
|
default: false
|
|
52
|
+
},
|
|
53
|
+
raceProgressionMode: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
title: 'Mark detection mode',
|
|
56
|
+
enum: ['auto', 'suggest', 'off'],
|
|
57
|
+
enumNames: ['Automatic', 'Suggest', 'Off'],
|
|
58
|
+
default: 'auto',
|
|
59
|
+
description: 'Automatic advances the active course point when the onboard app detects a rounding, start or finish; it also records evidence for Wake Logger. Suggest asks the crew first. Off records evidence only.'
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;YACjC,SAAS,EAAE,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;YACjD,OAAO,EAAE,WAAW;YACpB,WAAW,EAAE,qIAAqI;SACnJ;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,qFAAqF;SACnG;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,gDAAgD;YACzD,OAAO,EAAE,WAAW;SACrB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gCAAgC;YACvC,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;SACd;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,iCAAiC;YACxC,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,GAAG;SACb;QACD,aAAa,EAAE;YACb,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,kCAAkC;YACzC,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,CAAC;SACX;QACD,cAAc,EAAE;YACd,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gCAAgC;YACvC,OAAO,EAAE,KAAK;SACf;KACF;CACO,CAAA"}
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;YACjC,SAAS,EAAE,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;YACjD,OAAO,EAAE,WAAW;YACpB,WAAW,EAAE,qIAAqI;SACnJ;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,qFAAqF;SACnG;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,gDAAgD;YACzD,OAAO,EAAE,WAAW;SACrB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gCAAgC;YACvC,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;SACd;QACD,WAAW,EAAE;YACX,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,iCAAiC;YACxC,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,GAAG;SACb;QACD,aAAa,EAAE;YACb,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,kCAAkC;YACzC,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,CAAC;SACX;QACD,cAAc,EAAE;YACd,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gCAAgC;YACvC,OAAO,EAAE,KAAK;SACf;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,qBAAqB;YAC5B,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;YAChC,SAAS,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC;YAC1C,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,wMAAwM;SACtN;KACF;CACO,CAAA"}
|
|
@@ -87,6 +87,12 @@ class NativeCourseService {
|
|
|
87
87
|
throw new protocol_1.CourseError('native_routes_unavailable');
|
|
88
88
|
if (failure.status === 404 || failure.statusCode === 404 || failure.code === 'ENOENT' || /not found/i.test(failure.message ?? ''))
|
|
89
89
|
return undefined;
|
|
90
|
+
// Signal K 2.31's file-backed resource provider can briefly expose a
|
|
91
|
+
// partial file while its write settles (an empty/incomplete JSON read).
|
|
92
|
+
// Treat that transient state as "not readable yet" so the ensureResource
|
|
93
|
+
// read-back loop retries instead of rejecting the whole course with a 409.
|
|
94
|
+
if (error instanceof SyntaxError || /unexpected end of json|unexpected token|invalid json|not readable|EBUSY|EAGAIN/i.test(failure.message ?? ''))
|
|
95
|
+
return undefined;
|
|
90
96
|
throw error;
|
|
91
97
|
}
|
|
92
98
|
}
|
|
@@ -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CAAC,IAAI,KAAK,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;gBAAE,OAAO,SAAS,CAAA;YACnJ,qEAAqE;YACrE,wEAAwE;YACxE,yEAAyE;YACzE,2EAA2E;YAC3E,IAAI,KAAK,YAAY,WAAW,IAAI,iFAAiF,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;gBAAE,OAAO,SAAS,CAAA;YACnK,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;IACO,eAAe,KAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAAE,MAAM,IAAI,sBAAW,CAAC,2BAA2B,CAAC,CAAA,CAAC,CAAC;CAC9G;AA3ED,kDA2EC;AACD,SAAS,OAAO,CAAC,KAAc,EAAE,QAAgB;IAC/C,MAAM,SAAS,GAAG,KAA+B,CAAA;IACjD,OAAO,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,KAAK,QAAQ,CAAA;AAC1E,CAAC"}
|
package/dist/courses/protocol.js
CHANGED
|
@@ -41,13 +41,18 @@ function parseCourse(payload) {
|
|
|
41
41
|
if (doc.activeWaypointIndex !== undefined && (!Number.isSafeInteger(doc.activeWaypointIndex)
|
|
42
42
|
|| doc.activeWaypointIndex < 0 || doc.activeWaypointIndex >= points.length))
|
|
43
43
|
throw new CourseError('course_invalid_point_index');
|
|
44
|
+
if (doc.courseDefinitionDigest !== undefined && !isDigest(doc.courseDefinitionDigest))
|
|
45
|
+
throw new CourseError('course_invalid_digest');
|
|
44
46
|
return {
|
|
45
47
|
v: 1, action: 'activate', revision: doc.revision, courseId: doc.courseId, name: doc.name, updatedAt: doc.updatedAt,
|
|
46
48
|
start: point(doc.start), marks: doc.marks.map(point), finish: point(doc.finish),
|
|
47
49
|
...(Number.isSafeInteger(doc.racePlanId) ? { racePlanId: doc.racePlanId } : {}),
|
|
50
|
+
...(isDigest(doc.courseDefinitionDigest) ? { courseDefinitionDigest: doc.courseDefinitionDigest.toLowerCase() } : {}),
|
|
48
51
|
...(doc.activeWaypointIndex !== undefined ? { activeWaypointIndex: doc.activeWaypointIndex } : {})
|
|
49
52
|
};
|
|
50
53
|
}
|
|
54
|
+
const COURSE_DIGEST = /^[0-9a-fA-F]{64}$/;
|
|
55
|
+
function isDigest(value) { return typeof value === 'string' && COURSE_DIGEST.test(value); }
|
|
51
56
|
function point(value) { return { id: value.id, name: value.name, latitude: value.latitude, longitude: value.longitude, ...(value.notes !== undefined ? { notes: value.notes } : {}) }; }
|
|
52
57
|
function validText(value, maximum) { return typeof value === 'string' && value.trim().length > 0 && value.length <= maximum; }
|
|
53
58
|
function validPoint(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/courses/protocol.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/courses/protocol.ts"],"names":[],"mappings":";;;AA6BA,oCAAmI;AACnI,kCA0BC;AA9BD,MAAa,WAAY,SAAQ,KAAK;IACf;IAArB,YAAqB,IAAY;QAAI,KAAK,CAAC,IAAI,CAAC,CAAA;QAA3B,SAAI,GAAJ,IAAI,CAAQ;IAAgB,CAAC;CACnD;AAFD,kCAEC;AACD,SAAgB,YAAY,CAAC,MAA4B,IAAmB,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA,CAAC,CAAC;AACnI,SAAgB,WAAW,CAAC,OAAe;IACzC,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE,GAAG,IAAI;QAAE,MAAM,IAAI,WAAW,CAAC,kBAAkB,CAAC,CAAA;IACzE,IAAI,KAAc,CAAA;IAClB,IAAI,CAAC;QAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CA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