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

Type mismatch crash at SDK on timeout error #200

Open
4 tasks
sharansingh00002 opened this issue Feb 23, 2022 · 1 comment · May be fixed by #201
Open
4 tasks

Type mismatch crash at SDK on timeout error #200

sharansingh00002 opened this issue Feb 23, 2022 · 1 comment · May be fixed by #201
Labels

Comments

@sharansingh00002
Copy link

sharansingh00002 commented Feb 23, 2022

Describe the bug
When fetching feed using SDK, In case of timeout error there is a type mismatch crash at SDK side, instead of getting the timeout error logs through the SDK we are getting type mismatch error.

What version of Flutter do you use?
2.5.3

What package are you using? What version?
0.5.0

What platform is it about?

  • [ Y] Android
  • [ Y] iOS
  • Web
  • Windows
  • MacOS
  • Linux

To Reproduce
Steps to reproduce the behavior:

  1. Set the timeout value in SDK to some less value like 5 sec
  2. Fetch feed using SDK
  3. See error

Expected behavior

I/flutter (20724): (2022-02-18 13:10:38.274839) 🚨 📜 ╔╣ DioError ║ DioErrorType.connectTimeout
I/flutter (20724): (2022-02-18 13:10:38.275134) 🚨 📜 ║  Connecting timed out [1000ms]
I/flutter (20724): (2022-02-18 13:10:38.275303) 🚨 📜 ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
I/flutter (20724): (2022-02-18 13:10:38.275737) 🚨 📜 
I/flutter (20724): (2022-02-18 13:10:38.275910) 🚨 📜 ╔╣ Request ║ GET 
I/flutter (20724): (2022-02-18 13:10:38.276026) 🚨 📜 ║  https://api.stream-io-api.com/api/v1.0/enrich/feed/trending/all/?api_key=**&location=**&limit=100&offset=0&with_own_reactions=true&with_reaction_counts=true&with_own_children=true&ranking=**
I/flutter (20724): (2022-02-18 13:10:38.276200) 🚨 📜 ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
I/flutter (20724): NoSuchMethodError: The getter 'length' was called on null.
I/flutter (20724): Receiver: null
I/flutter (20724): Tried calling: length #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:63:5)
I/flutter (20724): #1      _parseJson (dart:convert-patch/convert_patch.dart:39:28)
I/flutter (20724): #2      JsonDecoder.convert (dart:convert/json.dart:506:36)
I/flutter (20724): #3      JsonCodec.decode (dart:convert/json.dart:157:41)
I/flutter (20724): #4      new StreamFeedsNetworkError.fromDioError (package:stream_feed/src/core/error/stream_feeds_error.dart:45:23)
I/flutter (20724): #5      StreamHttpClient._parseError (package:stream_feed/src/core/http/stream_http_client.dart:81:39)
I/flutter (20724): #6      StreamHttpClient.get (package:stream_feed/src/core/http/stream_http_client.dart:105:13)
I/flutter (20724): <asynchronous suspension>
I/flutter (20724): #7      FlatFeed.getEnrichedActivities (package:stream_feed/src/client/flat_feed.dart:133:20)
I/flutter (20724): <asynchronous suspension>
I/flutter (20724): #8      FutureExtensions.onError.<anonymous closure> (dart:async/future.dart)
I/flutter (20724): <asynchronous suspension>
[sentry] [debug] Event 7c8bd7b4f4af45c694596abf63036512 was dropped due to sampling decision```
@sharansingh00002 sharansingh00002 added the bug Something isn't working label Feb 23, 2022
@sachaarbonel sachaarbonel linked a pull request Feb 23, 2022 that will close this issue
@sachaarbonel
Copy link
Member

Hi @sharansingh00002, thanks for opening an issue. Can you try if this fix works for you?

dependencies:   
  stream_feed:
     git:
       url: https://github.com/GetStream/stream-feed-flutter.git
       ref: timeout-error
       path: ./packages/stream_feed

Also, regarding your timeout issue, you can choose a server location closer to you (for development purposes) or your users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants