robkorn / urbit-chatbot-framework

A framework that allows anyone to create an Urbit Chatbot with only a few lines of code.
MIT License
25 stars 7 forks source link

Bot "Replied to message" but no message appears in chat. #5

Closed ridoy closed 2 years ago

ridoy commented 2 years ago

Context Our bot stopped sending messages. The bot logs "Replied to message" though. I started experiencing this after Grid rolled out (~2 weeks ago). To doublecheck I cloned the repo again and built the example simple-chatbot, but that didn't work either.

Grid brought some breaking changes to graph-store: https://urbit.org/using/os/dist-faq#troubleshooting.

EDIT:

It looks like scries have new paths: https://gall-doc-generator.vercel.app/scries but that might not be the cause after all.

The message appears to make it all the way to send_put_request() in src/interface.rs. The request returns a 204 but graph-store isn't updated with the bot's message.

The following output in dojo at the time of each request:

http: %cancel not handled yet
clay: read-at-aeon fail [desk=%landscape care=%c case=[%da p=~2021.10.24..01.07.41..ddc5] path=/graph-update-2/graph-update-3]
[%no-cast-from %graph-update-2 %graph-update-3]
[%error-building-cast %graph-update-2 %graph-update-3]
[%error-building-tube %graph-update-2 %graph-update-3]
/sys/vane/clay/hoon:<[4.258 13].[4.258 34]>
/sys/vane/clay/hoon:<[4.245 7].[4.271 9]>

Reproduce

  1. Have the latest OTA update
  2. Build example chatbot from scratch and Run
  3. Send message in from main ship in chat, verify no message is sent by bot

Environment Running a Moon in Terminal and Planet from Port. Both are up to date. Specs: Macbook Pro Retina 2015, macOS Mojave 10.14.6

robkorn commented 2 years ago

Most likely rust-urbit-http-api has to be updated to work with the latest OTAs. Unfortunately I do not have spare cycles these days to go and debug this by hand and update the code.

If you manage to figure out the root issue and fix it, please do submit a PR and I will gladly merge it in.

ridoy commented 2 years ago

Understood, thanks.

ridoy commented 2 years ago

@robkorn I updated the issue with a potential root cause and logs. Do you know what might be happening? I'm not well versed in Hoon at all.

robkorn commented 2 years ago

@ridoy It appears that the library is using the @tas %graph-update-2 while it needs to be %graph-update-3. I've pushed a quick fix for this specific problem to the repo (https://github.com/robkorn/rust-urbit-http-api), so feel free to give it a go and see if it works now or if there are more breaking changes.

Regarding scries causing issues, sending messages happens via pokes (as scries are stateless reads), so pokes will be more relevant to look at if it sees messages but is not posting.

ridoy commented 2 years ago

That fixes it! Thanks so much @robkorn

robkorn commented 2 years ago

Great to hear, I've pushed v0.7.3 of the library with the update so you can use it in your project easily: https://crates.io/crates/urbit-http-api