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

feat(appservice): Add default request config #998

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

emgrav
Copy link
Contributor

@emgrav emgrav commented Sep 1, 2022

Adds an optional default RequestConfig to the appservice struct, which when present is used for any virtual clients created.

Closes #925

@emgrav emgrav marked this pull request as ready for review September 2, 2022 05:44
@emgrav emgrav force-pushed the emgrav/default-request-conf branch 2 times, most recently from a3adc8e to c1a176f Compare September 2, 2022 06:21
@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Base: 78.46% // Head: 78.41% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (39444db) compared to base (2818551).
Patch coverage: 30.76% of modified lines in pull request are covered.

❗ Current head 39444db differs from pull request most recent head 7417d86. Consider uploading reports for the commit 7417d86 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #998      +/-   ##
==========================================
- Coverage   78.46%   78.41%   -0.05%     
==========================================
  Files         110      110              
  Lines       15121    15133      +12     
==========================================
+ Hits        11864    11867       +3     
- Misses       3257     3266       +9     
Impacted Files Coverage Δ
crates/matrix-sdk-appservice/src/lib.rs 90.66% <30.76%> (-2.47%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@emgrav emgrav marked this pull request as draft September 2, 2022 10:30
@emgrav emgrav force-pushed the emgrav/default-request-conf branch 2 times, most recently from b66fe88 to f1f918f Compare September 16, 2022 08:07
.rustfmt.toml Outdated Show resolved Hide resolved
@emgrav emgrav marked this pull request as ready for review September 16, 2022 08:57
Copy link
Collaborator

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Would be good if the change to a builder pattern was a separate commit or even PR. Also there should be AppService::builder like there is Client::builder, so one doesn't have to import the builder type for common usage.

@emgrav
Copy link
Contributor Author

emgrav commented Sep 19, 2022

Opened a new PR for the builder pattern with the requested changes in #1051.

@jplatte
Copy link
Collaborator

jplatte commented Sep 22, 2022

With #1051 merged, this is now waiting on a rebase.

@emgrav emgrav force-pushed the emgrav/default-request-conf branch 2 times, most recently from b76381a to 973c3e8 Compare September 22, 2022 10:11
Copy link
Collaborator

@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Looks good now, just one nitpick.

crates/matrix-sdk-appservice/src/lib.rs Outdated Show resolved Hide resolved
@emgrav emgrav force-pushed the emgrav/default-request-conf branch 2 times, most recently from c17cb3d to 39444db Compare September 22, 2022 10:17
@jplatte
Copy link
Collaborator

jplatte commented Sep 22, 2022

This isn't actually a breaking change now that the conversion to builder pattern has already happened, right?

This adds a default RequestConfig to use when creating new virtual
clients.
@emgrav emgrav changed the title feat(appservice)!: Add default request config feat(appservice): Add default request config Sep 22, 2022
@jplatte jplatte merged commit cb94d60 into matrix-org:main Sep 22, 2022
@emgrav emgrav deleted the emgrav/default-request-conf branch September 26, 2022 06:39
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.

Request options for appservice clients
2 participants