Closed YKuvonchbek closed 4 years ago
I suppose, exactly at this line: https://github.com/tinode/ios/blob/devel/TinodeSDK/Tinode.swift#L1207 d
value equalized non nil value for head.
Actually, the problem is in parts[0] == String(describing: T.self)
debugger shows that parts[0] = Optional<Dictionary<String, JSONValue>
and String(describing: T.self)) = Dictionary<String, JSONValue>
that is why it is returning nil
value.
So it writes the type as Optional during serialization which is not good.
I think this should take care of it: https://github.com/tinode/ios/commit/fbd4a06306674d84b65ea3f379805a7a6348ae6f
Head values missing in this line: https://github.com/tinode/ios/blob/devel/TinodiosDB/MessageDb.swift#L209 I think Tinode.deserializeObject(from: r[self.head]) eqalizing JSON object to nill.