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

stash_dio crash when reading from hive cache #9

Closed
tjarvstrand opened this issue May 16, 2021 · 6 comments
Closed

stash_dio crash when reading from hive cache #9

tjarvstrand opened this issue May 16, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@tjarvstrand
Copy link
Contributor

tjarvstrand commented May 16, 2021

Describe the bug
When trying to read from the cache, the stash_dio_interceptor crashes when using stash_hive. It does not seem to work at all.

To Reproduce
Make two requests to seemingly any URL while using stash_dio with stash_hive

Expected behavior
An HTTP-response is returned both times.

Actual behavior
The second request crashes with:

E/flutter ( 2495): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'CacheValue' in type cast
E/flutter ( 2495): #0      CacheInterceptorBuilder._onRequest (package:stash_dio/src/dio/interceptor_builder.dart:133:43)
E/flutter ( 2495): <asynchronous suspension>

Version
dio: 4.0.0
stash: 2.0.2
stash_dio: 2.0.3
stash_hive: 2.0.3

@ivoleitao
Copy link
Owner

Let me try this with a cache that employs serialization

@ivoleitao ivoleitao self-assigned this May 16, 2021
@ivoleitao
Copy link
Owner

Yap fixed, I will send out a new version shortly. Sorry about this mistakes but this is one of the less tested package on stash as I plan to use it but didn't had the opportunity to do so.

@tjarvstrand
Copy link
Contributor Author

OK! If you're rolling out a new version, would you mind looking at this as well: #10 ?

@ivoleitao
Copy link
Owner

I've already merged it :-). I will push everything in the new version

@ivoleitao ivoleitao added the bug Something isn't working label May 16, 2021
@tjarvstrand
Copy link
Contributor Author

Thanks! :)

@ivoleitao
Copy link
Owner

Published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants