get10101 / 10101-PoC

The world needs more Lightning!
MIT License
17 stars 3 forks source link

Hot restart breaks rust logging #159

Closed holzeis closed 1 year ago

holzeis commented 1 year ago
Performing hot restart...                                               
Restarted application in 366ms.
flutter: {_TenTenOneState} {initState} {Successfully initialised wallet} {LogLevel.INFO} {09 November 2022 08:11:56 AM}
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: FfiException(PANIC_ERROR, Logger to initialise: Failed to init tracing

Caused by:
    a global default trace dispatcher has already been set, null)
#0      FlutterRustBridgeBase._transformRust2DartMessage (package:flutter_rust_bridge/src/basic.dart:101:9)
#1      FlutterRustBridgeBase.executeStream (package:flutter_rust_bridge/src/basic.dart:84:15)
<asynchronous suspension>
#2      _TenTenOneState.setupRustLogging.<anonymous closure> (package:ten_ten_one/main.dart:153:30)
<asynchronous suspension>
klochowicz commented 1 year ago

There's a PR open that fixes this problem: #155

holzeis commented 1 year ago

Reopening the issue as the error is still on main. Note the difference between hot reload and hot restart.

klochowicz commented 1 year ago

how do you make a hot restart?

holzeis commented 1 year ago

The flutter run commands are printed in the terminal.

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
klochowicz commented 1 year ago

@holzeis are you sure you see the same error as before? maybe you've run into #164 ?

here are the logs I see after trying it out right now:

2022-11-10 05:22:37 DEBUG ten_ten_one::wallet: Wallet sync called
2022-11-10 05:22:39 DEBUG ten_ten_one::wallet: Wallet balance balance={ immature: 0, trusted_pending: 0, untrusted_pending: 0, confirmed: 0 }

Performing hot restart...
Restarted application in 704ms.
flutter: {_TenTenOneState} {initState} {Successfully initialised wallet} {LogLevel.INFO} {10 November 2022 03:52:46 PM}

2022-11-10 05:22:47 DEBUG ten_ten_one::wallet: Wallet will be stored on disk data_dir="/Users/mariusz/Library/Containers/com.example.withFlutter/Data/Library/Application Support/com.example.withFlutter"
2022-11-10 05:22:47 DEBUG electrum_client::raw_client: new_ssl socket_addrs.domain():Some("blockstream.info") validate_domain:true timeout:None
2022-11-10 05:22:47 DEBUG rustls::client::hs: No cached session for DnsName(DnsName(DnsName("blockstream.info")))

please re-test it, and close the issue if it works now :-)

klochowicz commented 1 year ago

closing after @holzeis confirmed he ran into #164 , and that it works now.