920 sync new signatory#921
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #921 +/- ##
==========================================
- Coverage 70.52% 70.51% -0.02%
==========================================
Files 139 139
Lines 28361 28377 +16
==========================================
+ Hits 20001 20009 +8
- Misses 8360 8368 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #920 by improving post-invite synchronization for newly accepted company signatories: it strengthens DM subscription backfill behavior and adds a background sync step to reconstruct company state from historical bill-invite DMs.
Changes:
- Added a transport-level flow to query/decrypt historical private events for a company identity and process bill chain invites found there.
- Extended the transport client API with generic event resolution and a “try decrypt with any local signer” helper, and adjusted DM subscription filters to include a backfill limit.
- Updated company invite acceptance to ensure relevant Nostr contacts are present and to spawn the historical-invite processing job; updated mocks/tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/bcr-ebill-transport/src/transport_service.rs | Adds process_company_historical_bill_invites and wires in a bill-invite handler dependency to process recovered invites. |
| crates/bcr-ebill-transport/src/test_utils.rs | Extends the transport client mock with resolve_events and try_decrypt_private_event for updated trait coverage. |
| crates/bcr-ebill-transport/src/nostr.rs | Implements resolve_events and try_decrypt_private_event; adds a DM subscription backfill limit(1000) when adding an identity. |
| crates/bcr-ebill-transport/src/lib.rs | Passes the bill-invite handler into TransportService::new. |
| crates/bcr-ebill-api/src/service/transport_service/transport.rs | Extends TransportServiceApi with process_company_historical_bill_invites. |
| crates/bcr-ebill-api/src/service/transport_service/transport_client.rs | Extends TransportClientApi with resolve_events and try_decrypt_private_event. |
| crates/bcr-ebill-api/src/service/file_reference_helper.rs | Updates the local test mock to include the newly added transport service method. |
| crates/bcr-ebill-api/src/service/company_service.rs | Ensures contacts for company/signatories and spawns the historical bill-invite processing job after accepting a company invite; updates the baseline test expectations. |
…nd add unit tests for historical bill invite processing
📝 Description
This is a a fix plus an enhancement. First when we are added as signatory we also add a subscription with a limit param for DMs of the organization (this should fix message receive gaps when we where just invited and the transport was not reloaded with the new identity set). After the invite is accepted a background job is launched that pull in historic bill invites that the company received so we have the full company state local (blocks only pull bills that are issued by the company but not the ones it was invited to). This should create the same company final state as we have with recover.
Relates to #920
✅ Checklist
Please ensure the following tasks are completed before requesting a review:
cargo fmt.cargo clippy.📋 Review Guidelines
Please focus on the following while reviewing: