-
Notifications
You must be signed in to change notification settings - Fork 16
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
AuthCallback and InstanceStore Refactoring and documentation #250
AuthCallback and InstanceStore Refactoring and documentation #250
Conversation
…okenData` and simplify code
…auth-callback-state
… the StreamsChannel I also rename AblyLibrary to AblyInstanceStore. It stores instances
…tore and retrieve instances
…ify-auth-callback-state
…lutterPlugin (the heart of the plugin on iOS side)
…amed along time ago
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.
Please re-check your files and add newline
at the end of each modified file.
# Conflicts: # android/src/main/java/io/ably/flutter/plugin/AblyMethodCallHandler.java
…auth-callback-state # Conflicts: # android/src/main/java/io/ably/flutter/plugin/AblyMethodCallHandler.java
08b63ca
to
2b86b3e
Compare
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.
Light review warning - I skimmed through changes as this is a significantly big PR. One think I realised was use of lots of statics. As this is a refactor work I assume there is a good reason for them, but I have to say that use of lots of statics makes me anxious.
This work improves authCallback documentation so users can test locally more easily.
It also simplifies the code further, continuing the work of #231.
Mainly,
There is no need to save
tokenDetails
in AblyLibrary, it can be returned immediately in the callback.Once there, I wanted to improve the naming of
AblyLibrary
. It only does one thing: store instances, and so it's been renamed toAblyInstanceStore
.I also move the logic of creating clients outside of
AblyInstanceStore
. This paves the way for futher improvements: moving usage ofAblyInstanceStore
into the Codec as opposed to the method call handlers. Therefore, in the future, we might not need to deal with "handles", since we could deserialize the handle into the instance in the codec. This helps a transition to Swift too, since things are more decoupled.There's lots of refactoring going on in this file. There is no logic changes, except for the one above.
I'm sorry for making this PR so big.