Skip to content

refactor: externalize Arcs and make CoreCrypto: !Clone [WPB-25220]#2107

Open
coriolinus wants to merge 4 commits intomainfrom
prgn/refactor/25220-cc-not-clone
Open

refactor: externalize Arcs and make CoreCrypto: !Clone [WPB-25220]#2107
coriolinus wants to merge 4 commits intomainfrom
prgn/refactor/25220-cc-not-clone

Conversation

@coriolinus
Copy link
Copy Markdown
Contributor

What's new in this PR

Note: we'd do something similar for Database, externalizing its internal Arcs, but that ends up with a problem. For context, each CoreCrypto instance + several other places need to store an Arc<Database>, not just a Database, because we have to copy the database around into a bunch of places. Unfortunately, the Proteus PreKeyStore trait takes mutable references, which would mean that all those places need to store some kind of Arc<RwLock<Database>>, and at that point the cost-benefit analysis kind of stops being worth it.


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

coriolinus added 4 commits May 5, 2026 12:58
We don't actually need or want this, essentially ever.
So let's get rid of it. What we really want is a single
Arc which captures the whole thing.
We want an `Arc<CoreCrypto>` essentially every time instead of cloning;
this implements that.
CC keeps an outer `Arc` now, so we no longer need the inner ones.

The biggest change happened with Proteus, because that one (only)
used to have an accessor which depended on cheap clones to pass out
references. We just removed that for now.
@coriolinus coriolinus requested a review from a team May 5, 2026 14:51
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