-
Notifications
You must be signed in to change notification settings - Fork 253
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
chore: refactor AliceChopperAdapter
#191
chore: refactor AliceChopperAdapter
#191
Conversation
Hey, thanks for this refactor. When I run your adapter with alice_chopper example, it shows me this error. I think this is something with I/flutter ( 9961): Bad state: No element
I/flutter ( 9961): #0 Iterable.reduce (dart:core/iterable.dart:375:7)
I/flutter ( 9961): #1 AliceChopperAdapter.getRequestHashCode (package:alice_chopper/alice_chopper_adapter.dart:21:14)
I/flutter ( 9961): #2 AliceChopperAdapter.intercept (package:alice_chopper/alice_chopper_adapter.dart:37:23)
I/flutter ( 9961): <asynchronous suspension>
I/flutter ( 9961): #3 InterceptorChain.proceed (package:chopper/src/chain/interceptor_chain.dart:46:16)
I/flutter ( 9961): <asynchronous suspension>
I/flutter ( 9961): #4 RequestConverterInterceptor.intercept (package:chopper/src/interceptors/request_converter_interceptor.dart:26:7)
I/flutter ( 9961): <asynchronous suspension>
I/flutter ( 9961): #5 InterceptorChain.proceed (package:chopper/src/chain/interceptor_chain.dart:46:16)
I/flutter ( 9961): <asynchronous suspension>
I/flutter ( 9961): #6 Call.execute (package:chopper/src/chain/call.dart:56:12)
I/flutter ( 9961): <asynchronous suspension>
I/flutter ( 9961): #7 ChopperClient.send (package:chopper/src/base.dart:175:22)
I/flutter ( 9961): <asynchronous suspension> |
Oops ... lemme check 🙈 |
Maybe I was wrong and |
I fixed it. Can you please check it again? |
Working on it. I pushed an update that fixed it, but has some analysis issues. I'll check again in the evening. |
No worries, take your time. Thanks! |
@jhomlala right, this should now work as expected. It turns out that the I've also done extensive work on the Alice + Chopper example. CC / @Guldem |
@techouse Thanks for this amazing work! Yes, I think this UUID package is fine. Overall it's LGTM. Are you planning to add more refactors or are we ready to merge it? |
Nope. That's all she wrote. 🤣 |
Included in 1.0.3 version of alice_chopper. |
This PR refactors the Alice Chopper interceptor even further by:
removing the deprecatedturns out,alice_token
alice_token
is required to keep track of calls & responsesUUIDv4
as thealice_token
since it offers true uniqueness. In case this is not desired I can reverse back to microseconds. Note that milliseconds are NOT unique enough.body
size in a safer way