fix(watch): finalise correctif sync workoutHistory/exercise et distance live montre (#157)

This commit is contained in:
2026-07-29 11:22:17 +02:00
parent 6f913e4e8d
commit 30c6259748
28 changed files with 1658 additions and 248 deletions

View File

@ -1,4 +1,4 @@
const int watchBridgeSchemaVersion = 4;
const int watchBridgeSchemaVersion = 5;
enum WatchCommandType {
startCurrentExercise,
@ -140,6 +140,7 @@ final class WatchSessionProjection {
required this.deviceSessionId,
required this.revision,
required this.projectedAtEpochMs,
this.expiresAtEpochMs = 0,
required this.phase,
required this.phoneReachable,
required this.seriesIndex,
@ -166,6 +167,7 @@ final class WatchSessionProjection {
this.canDecrementScore = false,
this.manualScoreTargetValue,
this.manualScoreTargetLabel,
this.manualScoreRepsTargetValue,
this.manualScoreScope,
});
@ -178,6 +180,7 @@ final class WatchSessionProjection {
deviceSessionId: _stringFromJson(json['deviceSessionId']),
revision: _intFromJson(json['revision'], 0),
projectedAtEpochMs: _intFromJson(json['projectedAtEpochMs'], 0),
expiresAtEpochMs: _intFromJson(json['expiresAtEpochMs'], 0),
phase: _enumFromJson(
json['phase'],
WatchSessionPhase.values,
@ -221,6 +224,9 @@ final class WatchSessionProjection {
manualScoreTargetLabel: _nullableStringFromJson(
json['manualScoreTargetLabel'],
),
manualScoreRepsTargetValue: _nullableIntFromJson(
json['manualScoreRepsTargetValue'],
),
manualScoreScope: _nullableEnumFromJson(
json['manualScoreScope'],
WatchManualScoreScope.values,
@ -232,6 +238,7 @@ final class WatchSessionProjection {
final String deviceSessionId;
final int revision;
final int projectedAtEpochMs;
final int expiresAtEpochMs;
final WatchSessionPhase phase;
final bool phoneReachable;
final int seriesIndex;
@ -258,6 +265,7 @@ final class WatchSessionProjection {
final bool canDecrementScore;
final double? manualScoreTargetValue;
final String? manualScoreTargetLabel;
final int? manualScoreRepsTargetValue;
final WatchManualScoreScope? manualScoreScope;
Map<String, Object?> toJson() {
@ -266,6 +274,7 @@ final class WatchSessionProjection {
'deviceSessionId': deviceSessionId,
'revision': revision,
'projectedAtEpochMs': projectedAtEpochMs,
'expiresAtEpochMs': expiresAtEpochMs,
'phase': phase.name,
'phoneReachable': phoneReachable,
'seriesIndex': seriesIndex,
@ -296,6 +305,7 @@ final class WatchSessionProjection {
'canDecrementScore': canDecrementScore,
'manualScoreTargetValue': manualScoreTargetValue,
'manualScoreTargetLabel': manualScoreTargetLabel,
'manualScoreRepsTargetValue': manualScoreRepsTargetValue,
'manualScoreScope': manualScoreScope?.name,
};
}
@ -308,6 +318,7 @@ final class WatchSessionProjection {
deviceSessionId == other.deviceSessionId &&
revision == other.revision &&
projectedAtEpochMs == other.projectedAtEpochMs &&
expiresAtEpochMs == other.expiresAtEpochMs &&
phase == other.phase &&
phoneReachable == other.phoneReachable &&
seriesIndex == other.seriesIndex &&
@ -334,6 +345,7 @@ final class WatchSessionProjection {
canDecrementScore == other.canDecrementScore &&
manualScoreTargetValue == other.manualScoreTargetValue &&
manualScoreTargetLabel == other.manualScoreTargetLabel &&
manualScoreRepsTargetValue == other.manualScoreRepsTargetValue &&
manualScoreScope == other.manualScoreScope;
}
@ -344,6 +356,7 @@ final class WatchSessionProjection {
deviceSessionId,
revision,
projectedAtEpochMs,
expiresAtEpochMs,
phase,
phoneReachable,
seriesIndex,
@ -370,6 +383,7 @@ final class WatchSessionProjection {
canDecrementScore,
manualScoreTargetValue,
manualScoreTargetLabel,
manualScoreRepsTargetValue,
manualScoreScope,
]);
}