Skip to content

sync dev#256

Merged
ca333 merged 2 commits intodevfrom
ios_fix
Oct 26, 2025
Merged

sync dev#256
ca333 merged 2 commits intodevfrom
ios_fix

Conversation

@ca333
Copy link
Copy Markdown
Contributor

@ca333 ca333 commented Oct 26, 2025

includes ios specific fixes / enhancements

Copilot AI review requested due to automatic review settings October 26, 2025 12:00
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 26, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ios_fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);.

Copilot uses AI. Check for mistakes.
// Log electrum-related methods with more detail
if (method != null && _isElectrumRelatedMethod(method)) {
_logger.info('[ELECTRUM] Method: $method, Duration: ${stopwatch.elapsedMilliseconds}ms');
_logElectrumConnectionInfo(method, response);
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
final Duration _defaultPollingInterval = const Duration(seconds: 30);

/// Enable debug logging for balance polling
static bool enableDebugLogging = true;
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
static bool enableDebugLogging = true;
static bool enableDebugLogging = false;

Copilot uses AI. Check for mistakes.

/// Enable debug logging for RPC calls (method names, durations, success/failure)
/// This can be controlled via app configuration
static bool enableDebugLogging = true;
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
static bool enableDebugLogging = true;
static bool enableDebugLogging = false;

Copilot uses AI. Check for mistakes.

/// Enable debug logging for RPC calls (method names, durations, success/failure)
/// This can be controlled via app configuration
static bool enableDebugLogging = true;
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
static bool enableDebugLogging = true;
static bool enableDebugLogging = false;

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@ca333 ca333 merged commit 0b23126 into dev Oct 26, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants