Fixes #911 for company create, maybe fixes #912#915
Conversation
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
There was a problem hiding this comment.
Pull request overview
This PR updates the transport layer to allow explicitly registering a company’s Nostr signing keys (“identity”) earlier in the company lifecycle, so operations that publish signed Nostr events (notably file metadata) don’t fail with “No signer found for node_id …”. It does this by introducing a new add_identity API and using it during company creation and when accepting company invites.
Changes:
- Added
TransportServiceApi::add_identity(node_id, keys)and implemented it in the transport crate as a pass-through to the Nostr transport client. - Ensured company identities are registered with the transport layer before company file uploads on create, and before broadcasting chain events when accepting a company invite.
- Removed the older
add_company_transportAPI surface and related mocks/usages.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/bcr-ebill-transport/src/transport_service.rs | Implements the new add_identity method on the transport service. |
| crates/bcr-ebill-transport/src/test_utils.rs | Updates mocks to remove add_company_transport. |
| crates/bcr-ebill-transport/src/nostr_transport.rs | Renames/generalizes “add company keys” to add_identity and forwards to the transport client. |
| crates/bcr-ebill-transport/src/handler/company_invite_handler.rs | Comment tweak to reflect storing only the successfully-processed chain events. |
| crates/bcr-ebill-transport/src/block_transport.rs | Removes the old add_company_transport implementation. |
| crates/bcr-ebill-api/src/service/transport_service/transport.rs | Extends the public transport service trait with add_identity. |
| crates/bcr-ebill-api/src/service/transport_service/block_transport.rs | Removes add_company_transport from the block transport trait. |
| crates/bcr-ebill-api/src/service/file_reference_helper.rs | Updates the TransportServiceApi mock to include add_identity. |
| crates/bcr-ebill-api/src/service/company_service.rs | Calls add_identity before company file uploads on create, and before broadcasting on invite acceptance; updates tests accordingly. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #915 +/- ##
==========================================
+ Coverage 70.71% 70.73% +0.01%
==========================================
Files 139 139
Lines 27714 27713 -1
==========================================
+ Hits 19599 19603 +4
+ Misses 8115 8110 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📝 Description
Add company nostr keys to client before company file uploads are triggered on create. Also ensures that Nostr keys for company are present when accepting a company invite (Not sure if this actually fixes #912 as I don't know the error state and I currently don't see how we could be without keys on accept invite, can't reproduce).
Relates to #911 an #912, closes #911
✅ Checklist
Please ensure the following tasks are completed before requesting a review:
cargo fmt.cargo clippy.🚀 Changes Made
🤝 Related Issues
List any related issues, pull requests, or discussions:
📋 Review Guidelines
Please focus on the following while reviewing: