fix(train): a ride by the wheel goes out with its power, cadence and distance, and learns no wheel from tunnels (ADR 0030, D49, D51)
A trainer ride exported heart rates alone (or nothing) and a ride through tunnels the wheel's totals over GPS's distances; GPX's type came before its description and TCX's watts before the cadence, against their schemas. The wheel's size was learnt from rides GPS covered only in part. The live screen parsed the whole recording again on every sensor frame; now it reads each line once and shows sensors on the second's tick. The offline maps' requests time out after 20 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
236ac95eab
commit
c8f16686ec
1 changed files with 636 additions and 214 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
|
|
@ -124,6 +125,30 @@ void main() {
|
|||
expect(offline.kept.value['route-1']!.done, tilesOf(north).length);
|
||||
});
|
||||
|
||||
test('a tile that stalls is given up after the timeout, counted as one '
|
||||
"that didn't come", () async {
|
||||
server.stalling = true;
|
||||
final offline = OfflineMaps(
|
||||
folder,
|
||||
client: server.client,
|
||||
timeout: const Duration(milliseconds: 50),
|
||||
);
|
||||
await offline.keep('route-1', north, source);
|
||||
final stalled = offline.kept.value['route-1']!;
|
||||
expect(stalled.missing, stalled.total);
|
||||
expect(stalled.loading, isFalse);
|
||||
});
|
||||
|
||||
test('a style that stalls is out of reach', () async {
|
||||
server.stallingStyle = true;
|
||||
final offline = OfflineMaps(
|
||||
folder,
|
||||
client: server.client,
|
||||
timeout: const Duration(milliseconds: 50),
|
||||
);
|
||||
expect(await offline.keep('route-1', north, source), isFalse);
|
||||
});
|
||||
|
||||
test(
|
||||
'with the style out of reach nothing is kept, and that is said',
|
||||
() async {
|
||||
|
|
@ -302,11 +327,19 @@ class _Tiles() {
|
|||
bool empty = false;
|
||||
bool offline = false;
|
||||
|
||||
/// Whether the tiles, or the style, are asked for and never come.
|
||||
bool stalling = false;
|
||||
bool stallingStyle = false;
|
||||
|
||||
late final http.Client client = MockClient((request) async {
|
||||
if (offline) {
|
||||
throw const SocketException('offline');
|
||||
}
|
||||
final path = request.url.path;
|
||||
if ((stalling && path.startsWith('/planet/')) ||
|
||||
(stallingStyle && path.startsWith('/styles/'))) {
|
||||
return await Completer<http.Response>().future;
|
||||
}
|
||||
return switch (path) {
|
||||
'/styles/liberty' ||
|
||||
'/map/style/light.json' ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue