Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server and the Parse Flutter SDK.
Issue Description
I'm using parse dio client. When there is no internet connection (disabled wifi and LTE) and trying to do any operation with the parse server like (create or update or any operation from the ParseClient
class)
The dio throws a DioError
and in the SDK we convert the error to ParseNetworkResponse
Parse-SDK-Flutter/packages/dart/lib/src/network/parse_dio_client.dart
Lines 86 to 89 in af76c6b
And here is the bug the data
property in error.response
is null.
so the next exception will be thrown:
Type 'Null' is not a subtype of type 'String'
Steps to reproduce
-
init the Parse SDK with dio client
-
Disable wifi and LTE (cut off the internet of the device)
-
invoke
create
operation on parse object
Actual Outcome
_TypeError (type 'Null' is not a subtype of type 'String')
[log] #0 ParseDioClient.post
package:parse_server_sdk/…/network/parse_dio_client.dart:88
#1 ParseObject.create
package:parse_server_sdk/…/objects/parse_object.dart:71
#2 ChatRemoteDataSourceImpl.sendNewMessage
package:doors/…/data_source/chat_remote_data_source.dart:76
#3 SendTextMessageProcessManager._startSendingProcess
package:doors/…/process/send_text_message_process_manager.dart:69
#4 SendTextMessageBloc._onMessageSended
package:doors/…/send_text_message_bloc/send_text_message_bloc.dart:45
#5 new SendTextMessageBloc..
package:doors/…/send_text_message_bloc/send_text_message_bloc.dart:24
#6 new SendTextMessageBloc.
package:doors/…/send_text_message_bloc/send_text_message_bloc.dart:23
#7 Bloc.on..handleEvent
package:bloc/src/bloc.dart:211
Expected Outcome
ParseResponse
with error
Environment
Flutter version: 2.10.2
android emulator with android version: 9
Parse Flutter SDK
- SDK version:
3.1.2
- Operating system version:
Ubuntu 20.04.4 LTS x86_64
Server
- Parse Server version:
4.5.0