Merge remote-tracking branch 'origin/dev' into feat/network-map
# Conflicts: # lib/connector/meshcore_connector.dart
This commit is contained in:
commit
c18b509d7e
24 files changed
+1876
-340
No files matched your search
+17
-8
@@ -110,7 +110,10 @@ void main() async {
|
||||
// Availability/isBusy changes are the only thing that un-parks a decode
|
||||
// queue that stopped because the codec was unusable or busy.
|
||||
imageCodecService.addListener(receivedImageStore.notifyDecoderChanged);
|
||||
final imageReassembler = ImageStreamReassembler(store: receivedImageStore);
|
||||
final imageReassembler = ImageStreamReassembler(
|
||||
store: receivedImageStore,
|
||||
channelIdForSlot: connector.channelIdForSlot,
|
||||
);
|
||||
final imageTransport = ImageChunkTransport(
|
||||
reassembler: imageReassembler,
|
||||
// The UI sends whole chunk sets through connector.sendImageChunks so it
|
||||
@@ -159,6 +162,7 @@ void main() async {
|
||||
timeoutPredictionService: timeoutPredictionService,
|
||||
imageCodecService: imageCodecService,
|
||||
imageTransport: imageTransport,
|
||||
receivedImageStore: receivedImageStore,
|
||||
// ImageStreamReassembler.addChunk already forwards every outcome to the
|
||||
// store together with the channel index (which ImageChunkOutcome itself
|
||||
// does not carry), so onImageChunk would be a second, channel-blind path.
|
||||
@@ -171,11 +175,7 @@ void main() async {
|
||||
);
|
||||
|
||||
await connector.loadContactCache();
|
||||
await connector.loadChannelSettings();
|
||||
await connector.loadCachedChannels();
|
||||
|
||||
// Load persisted channel messages
|
||||
await connector.loadAllChannelMessages();
|
||||
await connector.loadUnreadState();
|
||||
|
||||
runApp(
|
||||
@@ -258,7 +258,7 @@ class AppSettingsImageCodecStore implements ImageCodecSettingsStore {
|
||||
|
||||
/// An [ImageReassembler] that (a) learns the local sender prefix after
|
||||
/// SELF_INFO and (b) forwards every outcome to [ReceivedImageStore] together
|
||||
/// with the channel index.
|
||||
/// with the channel index and the channel ID that slot holds.
|
||||
///
|
||||
/// Both exist because of upstream shapes this file cannot change:
|
||||
/// * `ImageReassembler.selfPrefix` is `final`, but the local public key does
|
||||
@@ -272,9 +272,12 @@ class AppSettingsImageCodecStore implements ImageCodecSettingsStore {
|
||||
class ImageStreamReassembler extends ImageReassembler {
|
||||
final ReceivedImageStore store;
|
||||
|
||||
/// Resolves the radio slot a chunk arrived on to its [Channel.storageId].
|
||||
final String? Function(int channelIndex)? channelIdForSlot;
|
||||
|
||||
int? _selfPrefix;
|
||||
|
||||
ImageStreamReassembler({required this.store})
|
||||
ImageStreamReassembler({required this.store, this.channelIdForSlot})
|
||||
: super(onFailed: ((failure) => unawaited(store.handleFailure(failure))));
|
||||
|
||||
@override
|
||||
@@ -289,7 +292,13 @@ class ImageStreamReassembler extends ImageReassembler {
|
||||
DateTime? now,
|
||||
}) {
|
||||
final outcome = super.addChunk(blob, channelIndex: channelIndex, now: now);
|
||||
unawaited(store.handleOutcome(outcome, channelIndex: channelIndex));
|
||||
unawaited(
|
||||
store.handleOutcome(
|
||||
outcome,
|
||||
channelIndex: channelIndex,
|
||||
channelId: channelIdForSlot?.call(channelIndex),
|
||||
),
|
||||
);
|
||||
return outcome;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user