ivk1800 / tdlib-dart

MIT License
19 stars 12 forks source link

Bug: type 'int' is not a subtype of type 'double' on self_destruct_in #3

Closed AndrewTran2018 closed 1 year ago

AndrewTran2018 commented 1 year ago

type 'int' is not a subtype of type 'double' E/flutter ( 6346): #0 Message.fromJson (package:tdlib/src/api/objects/message.dart:242:27) E/flutter ( 6346): #1 ConvertExtensions.toTdObject (package:tdlib/src/api/extensions/convert_extensions.dart:1

AndrewTran2018 commented 1 year ago

There are still a lot of bugs related to number conversion including int and double like this one. I fixed some, but to ensure its reliability please recheck and improve your code generator. I'm sick of these kinds of issues

AndrewTran2018 commented 1 year ago

@ivk1800

ivk1800 commented 1 year ago

There are steps to reproduce? selfDestructIn(self_destruct_in) is double in td_api.tl

What is value of selfDestructIn ? can you provider json example of message object?

AndrewTran2018 commented 1 year ago

There are steps to reproduce? selfDestructIn(self_destruct_in) is double in td_api.tl

What is value of selfDestructIn ? can you provider json example of message object

selfDetructIn is int in this case. That's why the line : selfDestructIn: json['self_destruct_in'] causes a crash.

ivk1800 commented 1 year ago

Fixed https://github.com/ivk1800/tdlib-dart/commit/d5ed66a6f32ef57a0047ab4610359b1eb3b45b25