Skip to content

Allow faraday client configuration #138

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srook
Copy link

@srook srook commented Apr 14, 2025

Enable additional configuration of Faraday client, allowing usage of different Faraday middleware.

This PR also partially resolves #59, as it allows configuring retry middleware.

@@ -202,6 +203,7 @@ def for_uri(uri, extra_headers = {})
extra_headers.each do |key, value|
faraday.headers[key] = value
end
@faraday_configurer.call(faraday) if @faraday_configurer
Copy link

Choose a reason for hiding this comment

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

Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.

@@ -12,10 +12,11 @@ class FCM
INSTANCE_ID_API = "https://iid.googleapis.com"
TOPIC_REGEX = /[a-zA-Z0-9\-_.~%]+/

def initialize(json_key_path = "", project_name = "", http_options = {})
def initialize(json_key_path = "", project_name = "", http_options = {}, faraday_configurer = nil)
Copy link

Choose a reason for hiding this comment

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

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [100/80]

@srook
Copy link
Author

srook commented Jun 3, 2025

@sabman can you take a look at this?

@sabman
Copy link
Member

sabman commented Jun 13, 2025

Just need to add a test - are you able to do that?

@srook srook force-pushed the customize-faraday-client branch from 6c1ed78 to 6c647c3 Compare June 13, 2025 13:36
@srook srook force-pushed the customize-faraday-client branch from 6c647c3 to efcc76a Compare June 13, 2025 13:38
@srook srook force-pushed the customize-faraday-client branch from efcc76a to 94e5da6 Compare June 13, 2025 13:41
@srook
Copy link
Author

srook commented Jun 13, 2025

Just need to add a test - are you able to do that?

sure. test added, please take a look

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.

Implement Retry with exponential backoff
2 participants