Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-flatten crate structure and get rid of PushService trait #331

Merged
merged 11 commits into from
Oct 17, 2024

Conversation

gferon
Copy link
Collaborator

@gferon gferon commented Oct 15, 2024

Since the actix implementation is not used anymore, and makes changes to the HTTP layer harder, I'm suggesting this big refactoring. No logic has changed, and this is a pure copy-pasta from the contents of libsignal-service-hyper.

Among the benefits stand out:

  • Better compilation error messages since we stop using async_trait (and static dispatch)
  • Less generics type parameters propagated everywhere
  • Our future ability to start using proper http types instead of having our own (weak) abstraction layer

This is a first step to refactor PushService and split the push_service.rs file in many smaller (and more readable) parts.

We can also start exposing different basic feature flags for toggling the TLS layer (maybe it is interesting to whisperfish to use OpenSSL?).

You can see the type of necessary changes downstream to whisperfish or presage (not that many) - whisperfish/presage#272

This is a first step to refactor PushService and split the push_service.rs file in many smaller parts.
@gferon gferon force-pushed the push-service-trait-no-more branch from 8295bc8 to cfd566b Compare October 15, 2024 16:37
@gferon gferon requested a review from rubdos October 15, 2024 16:38
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
Comment on lines -49 to -54
## Feature flags for libsignal-service

| Feature flag | Description |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `unsend-futures` | This feature removes the `Send` requirement on returned futures. Enabling this flag may be necessary for interoperability with other libraries that don't support `Send` such as actix. |

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure whether WF will be compatible for now without the Unsend feature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I can definitely check that. It was my understanding that this was only for libsignal-service-actix. I'll double check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

with whisperfish/whisperfish@e93ed19 I can confirm my initial suspicion, we can remove unsend-futures.

Checking whisperfish v0.6.0-dev (/Users/gferon/Developer/signal/whisperfish/whisperfish)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.52s

@gferon gferon merged commit ae55eb8 into main Oct 17, 2024
5 of 6 checks passed
@gferon gferon deleted the push-service-trait-no-more branch October 17, 2024 14:46
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.

2 participants