Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR syncs development changes focused on iOS platform stability and debugging improvements. The changes address DNS resolution issues on mobile platforms and add comprehensive debug logging for RPC operations and balance polling.
Key Changes:
- Added health check mechanism for KDF to detect and recover from backgrounding issues
- Implemented debug logging system for RPC calls and balance operations
- Fixed DNS resolution issues by using 127.0.0.1 instead of localhost
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/komodo_defi_sdk/lib/src/balances/balance_manager.dart | Added debug logging flag and log statements for balance polling operations |
| packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart | Added ensureKdfHealthy method delegation to underlying auth service |
| packages/komodo_defi_local_auth/lib/src/komodo_defi_local_auth.dart | Added ensureKdfHealthy public API with documentation |
| packages/komodo_defi_local_auth/lib/src/auth/auth_service.dart | Implemented ensureKdfHealthy method to check and restart KDF when unhealthy |
| packages/komodo_defi_framework/lib/src/operations/kdf_operations_native.dart | Changed localhost to 127.0.0.1 to avoid mobile DNS issues |
| packages/komodo_defi_framework/lib/src/client/kdf_api_client.dart | Added debug logging for RPC calls with timing and Electrum-specific details |
| packages/komodo_defi_framework/lib/komodo_defi_framework.dart | Added isHealthy method and debug logging for RPC operations with Electrum tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final stopwatch = Stopwatch()..start(); | ||
|
|
||
| try { | ||
| final response = _rpcCallback(request); |
There was a problem hiding this comment.
The response from _rpcCallback is not being awaited. Since executeRpc is declared as async and returns Future<JsonMap>, this synchronous call will cause the stopwatch timing and subsequent logging to execute before the RPC call completes. Change to final response = await _rpcCallback(request);.
| // Log electrum-related methods with more detail | ||
| if (method != null && _isElectrumRelatedMethod(method)) { | ||
| _logger.info('[ELECTRUM] Method: $method, Duration: ${stopwatch.elapsedMilliseconds}ms'); | ||
| _logElectrumConnectionInfo(method, response); |
There was a problem hiding this comment.
Cannot pass response (of type JsonMap) to _logElectrumConnectionInfo which expects JsonMap as its second parameter, but response here is a Future<JsonMap> since line 40 is not awaited. This will cause a type error at runtime.
| final Duration _defaultPollingInterval = const Duration(seconds: 30); | ||
|
|
||
| /// Enable debug logging for balance polling | ||
| static bool enableDebugLogging = true; |
There was a problem hiding this comment.
Debug logging is enabled by default in production code. Consider setting this to false by default and allowing it to be enabled via configuration to avoid performance overhead and log noise in production environments.
| static bool enableDebugLogging = true; | |
| static bool enableDebugLogging = false; |
|
|
||
| /// Enable debug logging for RPC calls (method names, durations, success/failure) | ||
| /// This can be controlled via app configuration | ||
| static bool enableDebugLogging = true; |
There was a problem hiding this comment.
Debug logging is enabled by default in production code. Consider setting this to false by default to avoid performance overhead and excessive logging in production environments.
| static bool enableDebugLogging = true; | |
| static bool enableDebugLogging = false; |
|
|
||
| /// Enable debug logging for RPC calls (method names, durations, success/failure) | ||
| /// This can be controlled via app configuration | ||
| static bool enableDebugLogging = true; |
There was a problem hiding this comment.
Debug logging is enabled by default in production code. Consider setting this to false by default to prevent performance degradation and log clutter in production.
| static bool enableDebugLogging = true; | |
| static bool enableDebugLogging = false; |
|
Visit the preview URL for this PR (updated for commit dad8672): https://komodo-playground--pr256-ios-fix-e5zhyhv1.web.app (expires Sun, 02 Nov 2025 12:05:25 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47 |
|
Visit the preview URL for this PR (updated for commit dad8672): https://kdf-sdk--pr256-ios-fix-92gycooe.web.app (expires Sun, 02 Nov 2025 12:06:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 9c1b6e6c010cf0b965c455ba7a69c4aedafa8a1d |
includes ios specific fixes / enhancements