wip(watch): sauvegarde travail en cours lot critique (#157 #163 #164 #174 #175 #178)

This commit is contained in:
2026-07-29 12:34:07 +02:00
parent f523a5a8b5
commit 74d6000606
26 changed files with 516 additions and 62 deletions

View File

@ -24,6 +24,8 @@ abstract interface class WatchBridgeNativeChannel {
Future<void> publishProjection(WatchSessionProjection projection);
Future<void> publishAlert(WatchAlertEnvelope alert);
Future<void> sendCommandAck(
WatchCommandEnvelope command,
WatchCommandAck ack, {
@ -129,6 +131,11 @@ final class MethodChannelWatchBridgeNativeChannel
);
}
@override
Future<void> publishAlert(WatchAlertEnvelope alert) {
return _invokeIgnoringMissingPlugin('publishAlert', alert.toJson());
}
@override
Future<void> requestCapabilityRefresh() {
return _invokeIgnoringMissingPlugin('requestCapabilityRefresh');

View File

@ -6,7 +6,8 @@ import '../../application/use_cases.dart';
import '../../application/watch_companion_use_cases.dart';
import 'native_watch_bridge_channel.dart';
final class WatchWearDataLayerAdapter implements WatchProjectionPublisher {
final class WatchWearDataLayerAdapter
implements WatchProjectionPublisher, WatchAlertPublisher {
WatchWearDataLayerAdapter({
required WatchBridgeNativeChannel nativeChannel,
required WatchCommandIngress commandIngress,
@ -108,6 +109,11 @@ final class WatchWearDataLayerAdapter implements WatchProjectionPublisher {
await _syncForegroundService(projection);
}
@override
Future<void> publishAlert(WatchAlertEnvelope alert) {
return _nativeChannel.publishAlert(alert);
}
Future<void> _enqueueCommand(WatchCommandEnvelope command) {
final run = _commandTail.then(
(_) => _handleCommand(command),