Skip to content

fix: missing error handling in create connection controller#2335

Merged
rolznz merged 1 commit into
masterfrom
fix/create-connection-missing-error-check
May 23, 2026
Merged

fix: missing error handling in create connection controller#2335
rolznz merged 1 commit into
masterfrom
fix/create-connection-missing-error-check

Conversation

@rolznz
Copy link
Copy Markdown
Member

@rolznz rolznz commented May 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling during connection creation to properly validate and report invalid configurations, preventing the process from continuing with incomplete or corrupted data.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e0cfd8d-d032-49de-ba7b-d1fe94c04fd8

📥 Commits

Reviewing files that changed from the base of the PR and between 1629653 and b173798.

📒 Files selected for processing (1)
  • nip47/controllers/create_connection_controller.go

📝 Walkthrough

Walkthrough

The pull request adds explicit error handling to HandleCreateConnectionEvent in the connection creation controller. When RequestMethods conversion to scopes fails, the handler now logs the error and publishes a NIP-47 error response before returning, preventing downstream logic from executing with invalid scopes.

Changes

Connection Creation Scope Validation

Layer / File(s) Summary
Error handling for scope conversion
nip47/controllers/create_connection_controller.go
HandleCreateConnectionEvent validates RequestMethodsToScopes conversion result, logging errors with request context and returning an early NIP-47 error response instead of continuing with potentially invalid scopes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

A tiny check keeps scopes from straying,
Error logs each request's saying,
Early return, no bad state stays,
Connection flows now safer ways! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding missing error handling in the create connection controller after a failed conversion operation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/create-connection-missing-error-check

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.

@rolznz rolznz merged commit ee001d1 into master May 23, 2026
12 checks passed
@rolznz rolznz deleted the fix/create-connection-missing-error-check branch May 23, 2026 08:29
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.

1 participant