-
Notifications
You must be signed in to change notification settings - Fork 155
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
try to restructure fcm client #107
base: master
Are you sure you want to change the base?
Conversation
@Roy-Mao as much as I appreciate you taking interest in the gem I would like us to make sure that the gem stays simple and easy to maintain. So the level abstraction should not feel overly engineered. Just keep that in mind. |
Thanks! I think it would be better if we split FCM client class into two separate classes, supporting api-key and oauth2.0 protocal respectively.
Can I have write access to this repository so that I can create a new branch for this improvement? |
a1961ea
to
9953ec9
Compare
@Roy-Mao let's do a joint review first. Just let me know when this branch is ready to be reviewed and we can maybe even jump on a call and review this refactor together 😄 🚀 |
0885c06
to
3d7cd6e
Compare
sure! I am working on it. Will let you know once it is ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
undefined method `map!' for "spec/*.rb":String
undefined method `map!' for "spec/*.rb":String /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:296:in `block in make_excludes_absolute' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:268:in `each_key' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:292:in `make_excludes_absolute' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:239:in `check' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:231:in `create' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config_loader.rb:54:in `load_file' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config_loader.rb:83:in `configuration_from_file' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config_store.rb:44:in `for' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/cli.rb:181:in `apply_default_formatter' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/cli.rb:40:in `run' /home/linters/.bundle/gems/rubocop-0.54.0/bin/rubocop:13:in `block in ' /usr/local/lib/ruby/2.6.0/benchmark.rb:308:in `realtime' /home/linters/.bundle/gems/rubocop-0.54.0/bin/rubocop:12:in `' /home/linters/.bundle/bin/rubocop:23:in `load' /home/linters/.bundle/bin/rubocop:23:in `' /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load' /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load' /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run' /usr/local/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /usr/local/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /usr/local/lib/ruby/2.6.0/bundler/cli.rb:18:in `start' /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in ' /usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors' /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
undefined method `map!' for "spec/*.rb":String
undefined method `map!' for "spec/*.rb":String /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:296:in `block in make_excludes_absolute' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:268:in `each_key' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:292:in `make_excludes_absolute' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:239:in `check' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config.rb:231:in `create' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config_loader.rb:54:in `load_file' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config_loader.rb:83:in `configuration_from_file' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/config_store.rb:44:in `for' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/cli.rb:181:in `apply_default_formatter' /home/linters/.bundle/gems/rubocop-0.54.0/lib/rubocop/cli.rb:40:in `run' /home/linters/.bundle/gems/rubocop-0.54.0/bin/rubocop:13:in `block in ' /usr/local/lib/ruby/2.6.0/benchmark.rb:308:in `realtime' /home/linters/.bundle/gems/rubocop-0.54.0/bin/rubocop:12:in `' /home/linters/.bundle/bin/rubocop:23:in `load' /home/linters/.bundle/bin/rubocop:23:in `' /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load' /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load' /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run' /usr/local/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /usr/local/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch' /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /usr/local/lib/ruby/2.6.0/bundler/cli.rb:18:in `start' /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in ' /usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors' /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `'
06e2849
to
f8cfbca
Compare
f8cfbca
to
e336da7
Compare
This PR aims to share with you a general idea of where to improve in the gem and how can we improve it. Where to improve
PR content
Future improvements
I have no intention of merging it to the master branch right now, which is very risky.
@sabman |
@Roy-Mao yes that would be awesome let's do a call. Can you send me meeting request for later next week via https://calendly.com/sabman and we can do a paired code review |
module Fcm | ||
# underhood http client using faraday with typhoeus adapter | ||
module Connection | ||
DEFAULT_TIMEOUT = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo:
its better to overwrite the value.
Just spent some time being confused why the V1 didnt work on topic subscriptions -- I think this merge would help alot of people. |
@chrisedington I was waiting for @Roy-Mao to add tests. But seems he's busy now. I'll take a look next week. |
Sorry for the late reply, I am very busy recently. It would be very helpful if someone can help me add some tests for all the public methods. I will look back into this PR weekend!! |
split Fcm class into separate client classes based on the protocols used.