fix flutter/dart wasm

This commit is contained in:
Christien Rioux 2024-03-17 10:54:37 -04:00
parent 6a8c0830d2
commit 3970b6f294
11 changed files with 195 additions and 107 deletions

View File

@ -156,10 +156,12 @@ impl RPCOperationInspectValueA {
// Ensure seqs returned does not exceeed subkeys requested // Ensure seqs returned does not exceeed subkeys requested
#[allow(clippy::unnecessary_cast)] #[allow(clippy::unnecessary_cast)]
if self.seqs.len() > inspect_value_context.subkeys.len() as usize { if self.seqs.len() as u64 > inspect_value_context.subkeys.len() as u64 {
return Err(RPCError::protocol( return Err(RPCError::protocol(format!(
"InspectValue seqs length is greater than subkeys requested", "InspectValue seqs length is greater than subkeys requested: {} > {}",
)); self.seqs.len(),
inspect_value_context.subkeys.len()
)));
} }
// Validate descriptor // Validate descriptor

View File

@ -156,7 +156,7 @@ impl StorageManager {
// Get number of subkeys from schema and ensure we are getting the // Get number of subkeys from schema and ensure we are getting the
// right number of sequence numbers betwen that and what we asked for // right number of sequence numbers betwen that and what we asked for
#[allow(clippy::unnecessary_cast)] #[allow(clippy::unnecessary_cast)]
if answer.seqs.len() != descriptor_info.subkeys.len() as usize { if answer.seqs.len() as u64 != descriptor_info.subkeys.len() as u64 {
// Not the right number of sequence numbers // Not the right number of sequence numbers
// Move to the next node // Move to the next node
return Ok(NetworkResult::invalid_message(format!( return Ok(NetworkResult::invalid_message(format!(

View File

@ -771,7 +771,7 @@ impl StorageManager {
#[allow(clippy::unnecessary_cast)] #[allow(clippy::unnecessary_cast)]
{ {
assert!( assert!(
local_inspect_result.subkeys.len() as usize == local_inspect_result.seqs.len(), local_inspect_result.subkeys.len() as u64 == local_inspect_result.seqs.len() as u64,
"mismatch between local subkeys returned and sequence number list returned" "mismatch between local subkeys returned and sequence number list returned"
); );
} }
@ -824,8 +824,8 @@ impl StorageManager {
#[allow(clippy::unnecessary_cast)] #[allow(clippy::unnecessary_cast)]
{ {
assert_eq!( assert_eq!(
result.inspect_result.subkeys.len() as usize, result.inspect_result.subkeys.len() as u64,
result.fanout_results.len(), result.fanout_results.len() as u64,
"mismatch between subkeys returned and fanout results returned" "mismatch between subkeys returned and fanout results returned"
); );
} }

View File

@ -76,6 +76,7 @@ class DefaultFixture {
_veilidUpdateSubscription = us.listen((update) { _veilidUpdateSubscription = us.listen((update) {
if (update is VeilidLog) { if (update is VeilidLog) {
// print(update.message);
} else if (update is VeilidUpdateAttachment) { } else if (update is VeilidUpdateAttachment) {
} else if (update is VeilidUpdateConfig) { } else if (update is VeilidUpdateConfig) {
} else if (update is VeilidUpdateNetwork) { } else if (update is VeilidUpdateNetwork) {

View File

@ -16,7 +16,7 @@ Future<void> testOpenDeleteTableDb() async {
final tdb = await Veilid.instance.openTableDB(testDb, 1); final tdb = await Veilid.instance.openTableDB(testDb, 1);
try { try {
expect(() async => await Veilid.instance.deleteTableDB(testDb), await expectLater(() async => await Veilid.instance.deleteTableDB(testDb),
throwsA(isA<VeilidAPIException>())); throwsA(isA<VeilidAPIException>()));
} finally { } finally {
tdb.close(); tdb.close();

View File

@ -0,0 +1,3 @@
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver();

View File

@ -144,12 +144,12 @@ sealed class VeilidUpdate with _$VeilidUpdate {
String? backtrace, String? backtrace,
}) = VeilidLog; }) = VeilidLog;
const factory VeilidUpdate.appMessage({ const factory VeilidUpdate.appMessage({
@Uint8ListJsonConverter() required Uint8List message, @Uint8ListJsonConverter.jsIsArray() required Uint8List message,
TypedKey? sender, TypedKey? sender,
String? routeId, String? routeId,
}) = VeilidAppMessage; }) = VeilidAppMessage;
const factory VeilidUpdate.appCall({ const factory VeilidUpdate.appCall({
@Uint8ListJsonConverter() required Uint8List message, @Uint8ListJsonConverter.jsIsArray() required Uint8List message,
required String callId, required String callId,
TypedKey? sender, TypedKey? sender,
String? routeId, String? routeId,

View File

@ -1338,11 +1338,16 @@ mixin _$VeilidUpdate {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -1364,11 +1369,11 @@ mixin _$VeilidUpdate {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -1392,11 +1397,14 @@ mixin _$VeilidUpdate {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -1568,11 +1576,16 @@ class _$VeilidLogImpl implements VeilidLog {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -1597,11 +1610,11 @@ class _$VeilidLogImpl implements VeilidLog {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -1628,11 +1641,14 @@ class _$VeilidLogImpl implements VeilidLog {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -1735,7 +1751,7 @@ abstract class _$$VeilidAppMessageImplCopyWith<$Res> {
__$$VeilidAppMessageImplCopyWithImpl<$Res>; __$$VeilidAppMessageImplCopyWithImpl<$Res>;
@useResult @useResult
$Res call( $Res call(
{@Uint8ListJsonConverter() Uint8List message, {@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId}); String? routeId});
} }
@ -1776,7 +1792,7 @@ class __$$VeilidAppMessageImplCopyWithImpl<$Res>
@JsonSerializable() @JsonSerializable()
class _$VeilidAppMessageImpl implements VeilidAppMessage { class _$VeilidAppMessageImpl implements VeilidAppMessage {
const _$VeilidAppMessageImpl( const _$VeilidAppMessageImpl(
{@Uint8ListJsonConverter() required this.message, {@Uint8ListJsonConverter.jsIsArray() required this.message,
this.sender, this.sender,
this.routeId, this.routeId,
final String? $type}) final String? $type})
@ -1786,7 +1802,7 @@ class _$VeilidAppMessageImpl implements VeilidAppMessage {
_$$VeilidAppMessageImplFromJson(json); _$$VeilidAppMessageImplFromJson(json);
@override @override
@Uint8ListJsonConverter() @Uint8ListJsonConverter.jsIsArray()
final Uint8List message; final Uint8List message;
@override @override
final Typed<FixedEncodedString43>? sender; final Typed<FixedEncodedString43>? sender;
@ -1829,11 +1845,16 @@ class _$VeilidAppMessageImpl implements VeilidAppMessage {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -1858,11 +1879,11 @@ class _$VeilidAppMessageImpl implements VeilidAppMessage {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -1889,11 +1910,14 @@ class _$VeilidAppMessageImpl implements VeilidAppMessage {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -1974,14 +1998,14 @@ class _$VeilidAppMessageImpl implements VeilidAppMessage {
abstract class VeilidAppMessage implements VeilidUpdate { abstract class VeilidAppMessage implements VeilidUpdate {
const factory VeilidAppMessage( const factory VeilidAppMessage(
{@Uint8ListJsonConverter() required final Uint8List message, {@Uint8ListJsonConverter.jsIsArray() required final Uint8List message,
final Typed<FixedEncodedString43>? sender, final Typed<FixedEncodedString43>? sender,
final String? routeId}) = _$VeilidAppMessageImpl; final String? routeId}) = _$VeilidAppMessageImpl;
factory VeilidAppMessage.fromJson(Map<String, dynamic> json) = factory VeilidAppMessage.fromJson(Map<String, dynamic> json) =
_$VeilidAppMessageImpl.fromJson; _$VeilidAppMessageImpl.fromJson;
@Uint8ListJsonConverter() @Uint8ListJsonConverter.jsIsArray()
Uint8List get message; Uint8List get message;
Typed<FixedEncodedString43>? get sender; Typed<FixedEncodedString43>? get sender;
String? get routeId; String? get routeId;
@ -1997,7 +2021,7 @@ abstract class _$$VeilidAppCallImplCopyWith<$Res> {
__$$VeilidAppCallImplCopyWithImpl<$Res>; __$$VeilidAppCallImplCopyWithImpl<$Res>;
@useResult @useResult
$Res call( $Res call(
{@Uint8ListJsonConverter() Uint8List message, {@Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId}); String? routeId});
@ -2044,7 +2068,7 @@ class __$$VeilidAppCallImplCopyWithImpl<$Res>
@JsonSerializable() @JsonSerializable()
class _$VeilidAppCallImpl implements VeilidAppCall { class _$VeilidAppCallImpl implements VeilidAppCall {
const _$VeilidAppCallImpl( const _$VeilidAppCallImpl(
{@Uint8ListJsonConverter() required this.message, {@Uint8ListJsonConverter.jsIsArray() required this.message,
required this.callId, required this.callId,
this.sender, this.sender,
this.routeId, this.routeId,
@ -2055,7 +2079,7 @@ class _$VeilidAppCallImpl implements VeilidAppCall {
_$$VeilidAppCallImplFromJson(json); _$$VeilidAppCallImplFromJson(json);
@override @override
@Uint8ListJsonConverter() @Uint8ListJsonConverter.jsIsArray()
final Uint8List message; final Uint8List message;
@override @override
final String callId; final String callId;
@ -2100,11 +2124,16 @@ class _$VeilidAppCallImpl implements VeilidAppCall {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -2129,11 +2158,11 @@ class _$VeilidAppCallImpl implements VeilidAppCall {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -2160,11 +2189,14 @@ class _$VeilidAppCallImpl implements VeilidAppCall {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -2245,7 +2277,7 @@ class _$VeilidAppCallImpl implements VeilidAppCall {
abstract class VeilidAppCall implements VeilidUpdate { abstract class VeilidAppCall implements VeilidUpdate {
const factory VeilidAppCall( const factory VeilidAppCall(
{@Uint8ListJsonConverter() required final Uint8List message, {@Uint8ListJsonConverter.jsIsArray() required final Uint8List message,
required final String callId, required final String callId,
final Typed<FixedEncodedString43>? sender, final Typed<FixedEncodedString43>? sender,
final String? routeId}) = _$VeilidAppCallImpl; final String? routeId}) = _$VeilidAppCallImpl;
@ -2253,7 +2285,7 @@ abstract class VeilidAppCall implements VeilidUpdate {
factory VeilidAppCall.fromJson(Map<String, dynamic> json) = factory VeilidAppCall.fromJson(Map<String, dynamic> json) =
_$VeilidAppCallImpl.fromJson; _$VeilidAppCallImpl.fromJson;
@Uint8ListJsonConverter() @Uint8ListJsonConverter.jsIsArray()
Uint8List get message; Uint8List get message;
String get callId; String get callId;
Typed<FixedEncodedString43>? get sender; Typed<FixedEncodedString43>? get sender;
@ -2367,11 +2399,16 @@ class _$VeilidUpdateAttachmentImpl implements VeilidUpdateAttachment {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -2396,11 +2433,11 @@ class _$VeilidUpdateAttachmentImpl implements VeilidUpdateAttachment {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -2427,11 +2464,14 @@ class _$VeilidUpdateAttachmentImpl implements VeilidUpdateAttachment {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -2640,11 +2680,16 @@ class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -2669,11 +2714,11 @@ class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -2700,11 +2745,14 @@ class _$VeilidUpdateNetworkImpl implements VeilidUpdateNetwork {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -2888,11 +2936,16 @@ class _$VeilidUpdateConfigImpl implements VeilidUpdateConfig {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -2917,11 +2970,11 @@ class _$VeilidUpdateConfigImpl implements VeilidUpdateConfig {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -2948,11 +3001,14 @@ class _$VeilidUpdateConfigImpl implements VeilidUpdateConfig {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -3152,11 +3208,16 @@ class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -3181,11 +3242,11 @@ class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -3212,11 +3273,14 @@ class _$VeilidUpdateRouteChangeImpl implements VeilidUpdateRouteChange {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?
@ -3440,11 +3504,16 @@ class _$VeilidUpdateValueChangeImpl implements VeilidUpdateValueChange {
required TResult Function( required TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace) VeilidLogLevel logLevel, String message, String? backtrace)
log, log,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender,
String? routeId)
appMessage, appMessage,
required TResult Function(@Uint8ListJsonConverter() Uint8List message, required TResult Function(
String callId, Typed<FixedEncodedString43>? sender, String? routeId) @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)
appCall, appCall,
required TResult Function(AttachmentState state, bool publicInternetReady, required TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady) bool localNetworkReady)
@ -3469,11 +3538,11 @@ class _$VeilidUpdateValueChangeImpl implements VeilidUpdateValueChange {
TResult? Function( TResult? Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult? Function(@Uint8ListJsonConverter() Uint8List message, TResult? Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult? Function( TResult? Function(
@Uint8ListJsonConverter() Uint8List message, @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId, String callId,
Typed<FixedEncodedString43>? sender, Typed<FixedEncodedString43>? sender,
String? routeId)? String? routeId)?
@ -3500,11 +3569,14 @@ class _$VeilidUpdateValueChangeImpl implements VeilidUpdateValueChange {
TResult Function( TResult Function(
VeilidLogLevel logLevel, String message, String? backtrace)? VeilidLogLevel logLevel, String message, String? backtrace)?
log, log,
TResult Function(@Uint8ListJsonConverter() Uint8List message, TResult Function(@Uint8ListJsonConverter.jsIsArray() Uint8List message,
Typed<FixedEncodedString43>? sender, String? routeId)? Typed<FixedEncodedString43>? sender, String? routeId)?
appMessage, appMessage,
TResult Function(@Uint8ListJsonConverter() Uint8List message, String callId, TResult Function(
Typed<FixedEncodedString43>? sender, String? routeId)? @Uint8ListJsonConverter.jsIsArray() Uint8List message,
String callId,
Typed<FixedEncodedString43>? sender,
String? routeId)?
appCall, appCall,
TResult Function(AttachmentState state, bool publicInternetReady, TResult Function(AttachmentState state, bool publicInternetReady,
bool localNetworkReady)? bool localNetworkReady)?

View File

@ -133,7 +133,8 @@ Map<String, dynamic> _$$VeilidLogImplToJson(_$VeilidLogImpl instance) =>
_$VeilidAppMessageImpl _$$VeilidAppMessageImplFromJson( _$VeilidAppMessageImpl _$$VeilidAppMessageImplFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json) =>
_$VeilidAppMessageImpl( _$VeilidAppMessageImpl(
message: const Uint8ListJsonConverter().fromJson(json['message']), message:
const Uint8ListJsonConverter.jsIsArray().fromJson(json['message']),
sender: json['sender'] == null sender: json['sender'] == null
? null ? null
: Typed<FixedEncodedString43>.fromJson(json['sender']), : Typed<FixedEncodedString43>.fromJson(json['sender']),
@ -144,7 +145,8 @@ _$VeilidAppMessageImpl _$$VeilidAppMessageImplFromJson(
Map<String, dynamic> _$$VeilidAppMessageImplToJson( Map<String, dynamic> _$$VeilidAppMessageImplToJson(
_$VeilidAppMessageImpl instance) => _$VeilidAppMessageImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'message': const Uint8ListJsonConverter().toJson(instance.message), 'message':
const Uint8ListJsonConverter.jsIsArray().toJson(instance.message),
'sender': instance.sender?.toJson(), 'sender': instance.sender?.toJson(),
'route_id': instance.routeId, 'route_id': instance.routeId,
'kind': instance.$type, 'kind': instance.$type,
@ -152,7 +154,8 @@ Map<String, dynamic> _$$VeilidAppMessageImplToJson(
_$VeilidAppCallImpl _$$VeilidAppCallImplFromJson(Map<String, dynamic> json) => _$VeilidAppCallImpl _$$VeilidAppCallImplFromJson(Map<String, dynamic> json) =>
_$VeilidAppCallImpl( _$VeilidAppCallImpl(
message: const Uint8ListJsonConverter().fromJson(json['message']), message:
const Uint8ListJsonConverter.jsIsArray().fromJson(json['message']),
callId: json['call_id'] as String, callId: json['call_id'] as String,
sender: json['sender'] == null sender: json['sender'] == null
? null ? null
@ -163,7 +166,8 @@ _$VeilidAppCallImpl _$$VeilidAppCallImplFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$$VeilidAppCallImplToJson(_$VeilidAppCallImpl instance) => Map<String, dynamic> _$$VeilidAppCallImplToJson(_$VeilidAppCallImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'message': const Uint8ListJsonConverter().toJson(instance.message), 'message':
const Uint8ListJsonConverter.jsIsArray().toJson(instance.message),
'call_id': instance.callId, 'call_id': instance.callId,
'sender': instance.sender?.toJson(), 'sender': instance.sender?.toJson(),
'route_id': instance.routeId, 'route_id': instance.routeId,

View File

@ -0,0 +1,5 @@
#!/bin/bash
echo Ensure chromedriver is running on port 4444 and you have compiled veilid-wasm with wasm_build.sh
pushd example 2>/dev/null
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d chrome $@
popd 2>/dev/null

View File

@ -644,6 +644,7 @@ pub fn routing_context_inspect_dht_record(
let res = routing_context let res = routing_context
.inspect_dht_record(key, subkeys, scope) .inspect_dht_record(key, subkeys, scope)
.await?; .await?;
APIResult::Ok(res) APIResult::Ok(res)
}) })
} }
@ -695,7 +696,7 @@ pub fn import_remote_private_route(blob: String) -> Promise {
#[wasm_bindgen()] #[wasm_bindgen()]
pub fn release_private_route(route_id: String) -> Promise { pub fn release_private_route(route_id: String) -> Promise {
let route_id: veilid_core::RouteId = veilid_core::deserialize_json(&route_id).unwrap(); let route_id: veilid_core::RouteId = veilid_core::RouteId::try_decode(&route_id).unwrap();
wrap_api_future_void(async move { wrap_api_future_void(async move {
let veilid_api = get_veilid_api()?; let veilid_api = get_veilid_api()?;
veilid_api.release_private_route(route_id)?; veilid_api.release_private_route(route_id)?;