Skip to content

Fixes #911 for company create, maybe fixes #912#915

Merged
tompro merged 1 commit into
masterfrom
fix-company-create-file-upload-keys
May 7, 2026
Merged

Fixes #911 for company create, maybe fixes #912#915
tompro merged 1 commit into
masterfrom
fix-company-create-file-upload-keys

Conversation

@tompro
Copy link
Copy Markdown
Collaborator

@tompro tompro commented May 7, 2026

📝 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:

  • My code adheres to the coding guidelines of this project.
  • I have run cargo fmt.
  • I have run cargo clippy.
  • I have added or updated tests (if applicable).
  • All CI/CD steps were successful.
  • I have updated the documentation (if applicable).
  • I have checked that there are no console errors or warnings.
  • I have verified that the application builds without errors.
  • I've described the changes made to the API. (modification, addition, deletion).

🚀 Changes Made

  • Bug Fixes:
    • Add company nostr keys to client before company file uploads are triggered on create

🤝 Related Issues

List any related issues, pull requests, or discussions:


📋 Review Guidelines

Please focus on the following while reviewing:

  • Does the code follow the repository's contribution guidelines?
  • Are there any potential bugs or performance issues?
  • Are there any typos or grammatical errors in the code or comments?

Copilot AI review requested due to automatic review settings May 7, 2026 12:55
@qodo-code-review
Copy link
Copy Markdown

ⓘ 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.

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 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_transport API 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.

Comment thread crates/bcr-ebill-api/src/service/company_service.rs
Comment thread crates/bcr-ebill-api/src/service/company_service.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.73%. Comparing base (2ad9151) to head (e2b9632).

Files with missing lines Patch % Lines
crates/bcr-ebill-transport/src/nostr_transport.rs 0.00% 3 Missing ⚠️
...rates/bcr-ebill-transport/src/transport_service.rs 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tompro tompro requested review from mtbitcr and zupzup May 7, 2026 13:13
Copy link
Copy Markdown
Collaborator

@zupzup zupzup left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@tompro tompro merged commit 01d7feb into master May 7, 2026
13 of 14 checks passed
@tompro tompro deleted the fix-company-create-file-upload-keys branch May 7, 2026 13:36
tompro added a commit that referenced this pull request May 8, 2026
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.

Accepting auth signer invite while still downloading bill information gives error Bug when uploading contact image/document

3 participants