lightning: add initial lightning address receive support#4224
Conversation
|
@CodeRabbit review |
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThis PR adds Lightning address support. The backend generates and registers a lightning address username (adjective+noun+number) via the Breez SDK, exposes it through a new ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/lightning/address.go`:
- Around line 52-109: The core retry and race-handling logic in
ensureLightningAddress is not covered by tests, so make the lightning-address
SDK interactions injectable like sparkStatus to unit test this path. Refactor
Lightning to route GetLightningAddress, CheckLightningAddressAvailable, and
RegisterLightningAddress through function fields or a small interface, then add
tests for the existing-address fast path, retry on unavailable usernames, and
the registration-failure recheck that continues when the username was claimed
concurrently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e33ddb04-412f-4adc-856d-afa1daf2a6d7
📒 Files selected for processing (12)
backend/backend.gobackend/lightning/address.gobackend/lightning/address_test.gobackend/lightning/address_words.gobackend/lightning/event.gobackend/lightning/handlers.gobackend/lightning/lightning.gobackend/lightning/lightning_test.gofrontends/web/src/api/lightning.tsfrontends/web/src/locales/en/app.jsonfrontends/web/src/routes/lightning/receive/receive.module.cssfrontends/web/src/routes/lightning/receive/receive.tsx
bznein
left a comment
There was a problem hiding this comment.
backend untested LGTM
I also took a look at the frontend and LGTM but up to you if you want someone else to review
thanks! Frontend is temporary anyway, I'll merge as is and then we'll need a separate PR to improve the send flow |
Configure the Breez SDK with the LNURL domain and expose the registered Lightning address through the backend and receive screen. If no address exists yet, the backend registers a random username and retries when a candidate becomes unavailable during registration. This is the first integration step for LNURL receive support. The ability to generate a new random address or choose a custom address will be added in a future commit.
Configure the Breez SDK with the LNURL domain and expose the registered Lightning address through the backend and receive screen. If no address exists yet, the backend registers a random username and retries when a candidate becomes unavailable during registration.
This is the first integration step for LNURL receive support. The ability to generate a new random address or choose a custom address will be added in a future commit.
Before asking for reviews, here is a check list of the most common things you might need to consider: