putty
(Derek Putnam)
July 8, 2024, 12:55pm
1
1 Like
Lhc_fl
(Linca)
July 10, 2024, 7:39am
3
I can’t reproduce it. Can you provide more detailed information, such as a list of plugins installed on the site, the site’s logs (at https://example.com/logs
), and under what circumstances this error occurs?
1 Like
Lhc_fl
(Linca)
July 12, 2024, 7:45am
7
Hi @putty
Thanks for your reporting! We have located the cause of the error and submitted a fix:
discourse:main
← discourse:fix-null-channel
opened 01:55AM - 12 Jul 24 UTC
In `topic_view` serializer, only topics that meet the tag containing `livestream… ` will have corresponding channel. The `chat_channel_id` of other topics will be `null`.
```ruby
add_to_serializer(:topic_view, :chat_channel_id) do
return nil if object.topic.topic_chat_channel.blank?
object.topic.topic_chat_channel.chat_channel_id
end
```
```ruby
def self.handle_topic_chat_channel_creation(topic)
return if topic.category.blank?
return if DiscourseLivestream::TopicChatChannel.exists?(topic_id: topic.id)
return if topic.tags.blank? || topic.tags.none? { |tag| tag.name == "livestream" }
```
In the original code, there is no handling of null cases, which will result in trying to obtain information of null channel and throwing 404.
This commit determines the case where `chat_channel_id` is `null`
before:
![image](https://github.com/user-attachments/assets/847c95f8-e6d4-44d5-a144-6e41a31428c9)
after:
(error be fixed)
related meta topic: https://meta.discourse.org/t/not-found-when-rsvping-to-event/315416
2 Likes
nat
(Natalie T)
Closed
July 15, 2024, 12:00am
8
This topic was automatically closed after 2 days. New replies are no longer allowed.