Error "Unknown action in form note" in WebApp, when you click on the button

46 views
Skip to first unread message

Panda58dev (Kirill)

unread,
Aug 30, 2024, 8:37:12 AM8/30/24
to Tinode General
The documentation for the drafty format (link) specifies several actions to click on the button, among them is the "note" action. In practice, if I specify this action, the error "Unknown action in form note" occurs. Looking into the code, I saw that there is actually no processing of such an action (link).

Test message with buttons:
{"data":{"topic":"usr30xS93xaTC8","from":"usr30xS93xaTC8","ts":"2024-08-30T12:00:53.400Z","seq":82,"head":{"mime":"text/x-drafty"},"content":{"ent":[{"data":{"act":"note","name":"generate_group"},"tp":"BN"},{"data":{"act":"note","name":"make_root"},"tp":"BN"}],"fmt":[{"len":4,"tp":"ST"},{"at":16,"len":1,"tp":"BR"},{"at":17,"len":16},{"at":33,"key":1,"len":25},{"at":58,"len":1,"tp":"BR"}],"txt":"Меню управления: Генерация групп Сделать пользователя ROOT test"}}}

Handler in devtools:


Am I doing something wrong?

Gene

unread,
Aug 30, 2024, 8:58:59 AM8/30/24
to Tinode General
Where do you see the error "Unknown action in form note" and what does WebApp have to do with gRPC?

What do you see in the logs (client-side and server-side)?

Panda58dev (Kirill)

unread,
Aug 30, 2024, 10:41:00 AM8/30/24
to Tinode General
This message appears in the browser console when you click on the button in the message. I think this can be considered a client-side log
There is nothing in the logs of the server side, because the client does not send anything.

Buttons (in drafty format) are sent by the bot via grpc. I'm trying to interact with the bot via WebApp.


пятница, 30 августа 2024 г. в 15:58:59 UTC+3, Gene:

Gene

unread,
Aug 30, 2024, 1:35:01 PM8/30/24
to Tinode General
'note' action is not implemented. Here is the handler:

If you want it handled, then you need to implement it yourself.

Panda58dev (Kirill)

unread,
Aug 30, 2024, 2:40:49 PM8/30/24
to Tinode General
I may be able to deal with the web version of the client, but I'm unlikely to deal with mobile clients. Then I will use the 'pub'.
Thanks for clarifying the situation, but the documentation is misleading.
пятница, 30 августа 2024 г. в 20:35:01 UTC+3, Gene:

Gene

unread,
Aug 31, 2024, 2:24:00 AM8/31/24
to Tinode General
On Friday, August 30, 2024 at 9:40:49 PM UTC+3 Panda58dev (Kirill) wrote:
I may be able to deal with the web version of the client, but I'm unlikely to deal with mobile clients. Then I will use the 'pub'.

If you need our assistance, please describe your use case. I.e. how are you going to use this functionality.
 
Thanks for clarifying the situation, but the documentation is misleading.

You are welcome to send a pull request with a correction.

Panda58dev (Kirill)

unread,
Sep 3, 2024, 9:00:05 AM9/3/24
to Tinode General
Added pull request: https://github.com/tinode/chat/pull/920

> "If you need our assistance, please describe your use case. I.e. how are you going to use this functionality."
I have already implemented it on 'pub', but I think that when using 'note', after clicking, the server should send a message to the grpc client "such a button was pressed". As far as I know, something similar is implemented in telegram. After receiving a message from the grpc server, the client (aka bot) can edit his message from the menu or send a new one. This way the chat will be less clogged. Imho.
суббота, 31 августа 2024 г. в 09:24:00 UTC+3, Gene:

Gene

unread,
Sep 4, 2024, 6:54:53 AM9/4/24
to Tinode General
On Tuesday, September 3, 2024 at 4:00:05 PM UTC+3 Panda58dev (Kirill) wrote:
Added pull request: https://github.com/tinode/chat/pull/920

There is a conflict.
Reply all
Reply to author
Forward
0 new messages