Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@louisinger
Copy link
Collaborator

@louisinger louisinger commented Nov 18, 2025

@altafan @sekulicd please review

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling across core services to prevent unexpected application restarts during recoverable error conditions.
    • Improved error logging and diagnostics for better system observability.
    • Increased resilience for wallet streaming and transaction processing operations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

The pull request replaces fatal logging with error logging across four service files in the internal package. When errors occur during event persistence, stream handling, or service startup, the application now logs the error and continues or returns early instead of terminating the process.

Changes

Cohort / File(s) Change Summary
Core and Database Service Error Handling
internal/core/application/service.go, internal/infrastructure/db/service.go
Replaced Fatalf calls with Errorf in SubmitOffchainTx and FinalizeOffchainTx methods (application layer), and in two updateProjections code paths (database layer). Functions now return early on error instead of terminating the process.
Infrastructure Service Error Handling
internal/infrastructure/wallet/wallet_client.go, internal/interface/grpc/service.go
Changed fatal termination to error logging with early return in GetNotificationChannel and GetReadyUpdate methods (wallet client) when EOF is encountered in streams, and in onReady() method (gRPC service) on service startup failure. Application no longer exits; goroutines stop cleanly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

  • Verify that removing Fatal calls does not compromise system reliability or create cascading failures in each service layer.
  • Confirm early returns preserve expected channel lifecycle and goroutine cleanup in wallet and gRPC services.
  • Check that error logging provides sufficient observability to detect issues that previously caused immediate termination.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Replace log.Fatal by log.Error' directly and clearly describes the primary change across all modified files in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0a23b8 and 60db4cb.

📒 Files selected for processing (4)
  • internal/core/application/service.go (2 hunks)
  • internal/infrastructure/db/service.go (2 hunks)
  • internal/infrastructure/wallet/wallet_client.go (2 hunks)
  • internal/interface/grpc/service.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
internal/interface/grpc/service.go (1)
pkg/errors/errors.go (1)
  • Error (39-46)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build and Scan
  • GitHub Check: integration tests
  • GitHub Check: unit tests
🔇 Additional comments (1)
internal/infrastructure/wallet/wallet_client.go (1)

162-191: The channel is properly closed in all paths—original concern is not validated.

Reviewing the actual caller in internal/interface/grpc/handlers/walletservice.go:126-138, when GetReadyUpdate closes the channel without sending a ready signal (line 134), the channel receive correctly returns with ok=false. The caller handles this via the check on line 135, preventing any indefinite blocking. The defer close(ch) in the goroutine ensures the channel is closed in all paths: EOF, ready signal, or other errors.

No indefinite blocking or misinterpretation risk exists. The change from log.Fatal to log.Error on line 174 is appropriate since this one-shot notification pattern allows graceful completion.


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.

@louisinger louisinger requested a review from altafan November 18, 2025 23:49
@altafan altafan merged commit e802acf into arkade-os:master Nov 19, 2025
5 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