tinode / ios

Tinodios: Tinode Messaging Client for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<head> missing in MessageDb

YKuvonchbek opened this issue · comments

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.

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:
fbd4a06