question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to parse JSON object as TDLib request: Unknown class "updateOption"

See original GitHub issue

Hi I download current source and add tdlib.native package from nuget to TDLib.Samples.GetChats project, update ApId and ApiHash and PhoneNumber, then run. after few moments exception occurred.

TdLib.TdException: 'Failed to parse JSON object as TDLib request: Unknown class "updateOption"' latest line of output:

'TDLib.Samples.GetChats.exe' (CoreCLR: clrhost): Loaded 'Anonymously Hosted DynamicMethods Assembly'. 
Exception thrown: 'TdLib.TdException' in System.Private.CoreLib.dll
An exception of type 'TdLib.TdException' occurred in System.Private.CoreLib.dll but was not handled in user code
Failed to parse JSON object as TDLib request: Unknown class "updateOption

image : https://ibb.co/6RY8bs0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:15

github_iconTop GitHub Comments

4reactions
Xilosofcommented, Jan 10, 2021

Ok, after several hours of searching, I understand that we do not need to install the options that come by update. I got a few new errors before I realized it. Here’s the timeline:

  1. Failed to parse JSON object as TDLib request: Unknown class “updateoption” - this error occurred due to overriding the datatype parameter. It is not necessary to touch it, it is a kind of class name for the json format. The Extra parameter can also be left untouched, because it is used by the library, for example, for id. You can simply delete these parameters and use the setOption method according to the documentation https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1set_option.html, passing only two parameters. After that, I started getting another error.
  2. TDLib. tdexception: “Option can’t be set” - Starting immediately with the “version” option. https://core.telegram.org/tdlib/options. According to the same documentation, the options on which such an exception was made are forbidden to write. It is logical, because we do not need to change the version of tdlib. Therefore, updateoption only informs our application about the option change or occurs during initialization. For example so that we can correctly display the current version in the corner of the app)))

I checked the documentation and it is not written anywhere in the need to set options after getting the event. And in the examples, it is often ignored in general. Solution: do not set the options that came for the event updateoption

0reactions
Xilosofcommented, Jan 10, 2021

Hi. I have the same problem. I am compile 1.7 tdlib and generate new classes with your code generator, but the problem was not solved. Another functions works correctly. изображение This happens when I try to run your sample project. If I comment “setOption”, everything works fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to parse JSON object as TDLib request: Unknown ...
Hi. I want registre user. I found in documentation this class. registerUser Class Referencefinal Inherits Function.
Read more >
Failed to Parse JSON [closed]
This is a very error prone way to create JSON. Instead, create a POJO and use Gson or Jackson to convert it to...
Read more >
tdlib
Telegram Tdlib is a complete library for creating telegram clients, it also has a simple tdjson ready-to-use library to ease the integration ...
Read more >
MessageSendingStateFailed class - td_api library - Dart API
API docs for the MessageSendingStateFailed class from the td_api library, for the Dart programming language.
Read more >
tdlibjson | OpenRepos.net — Community Repository System
a JSON-encoded string and `JsonValue` TDLib API class. * Added the methods `getApplicationConfig` and `saveApplicationLogEvent` to be used for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found