Query for `our` is broken
devth opened this issue · comments
!our
yetibotAPP 9:16 PM
:cop: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Position: 33 :cop:
I'll look into this 🦒
It happens when users is empty. Users being empty has to do with a bug where in some channels users are not properly set.
when that happens you see logs like:
20-10-10 17:47:37 d330af91d8ee INFO [yetibot.core.db.util:154] - db query ["SELECT * FROM yetibot_my WHERE ()"]
which shows the invalid SQL query.
So the local fix would be to detect empty users and return an error. This needs to be done in both our
and our <key>
command handlers.
The larger fix is to fix the users model, but that's a pretty epic undertaking.
now since i fixed the my command i don't get this error anymore. do you know how to reproduce it?
I don't know the exact repro to get yetibot to be not be aware of the users in a channel. Try DMing it, or inviting it to a channel. Maybe after you invite it, shut it down start it back up. Sorry 😞
You could simulate it by setting users
to []
in the functions, for testing, then removing that before committing.