discourse/plugins/chat
Joffrey JAFFEUX 274820d247
FIX: prevents exception when publishing processed ()
This regression happened in bd5c5c4b5f and is due to `message_bus_targets = calculate_publish_targets(chat_channel, chat_message)` expecting a `chat_channel` which was only defined after.

Example exception in logs:

```
Job exception: undefined local variable or method `chat_channel' for Chat::Publisher:Module

/var/www/discourse/plugins/chat/app/services/chat/publisher.rb:91:in `publish_processed!' 
/var/www/discourse/plugins/chat/app/jobs/regular/chat/process_message.rb:21:in `block in execute' 
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize' 
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize' 
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize' 
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize' 
/var/www/discourse/plugins/chat/app/jobs/regular/chat/process_message.rb:7:in `execute' 
/var/www/discourse/app/jobs/base.rb:249:in `block (2 levels) in perform' 
```

This commit also:
- adds a spec to ensure oneboxing is not regressing anymore
- increment the version on message processed to ensure callbacks are correctly ran

Note we should also have more tests in `Chat::Publisher`, this will be done when we move it to a proper service.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2023-04-16 10:30:33 +02:00
..
app FIX: prevents exception when publishing processed () 2023-04-16 10:30:33 +02:00
assets FIX: prevents exception when publishing processed () 2023-04-16 10:30:33 +02:00
config FEATURE: Initial chat thread indicator and disabling echo mode in channels () 2023-04-12 11:09:06 +10:00
db DEV: Chat thread reply counter cache () 2023-04-11 15:40:25 +10:00
lib FEATURE: Initial chat thread indicator and disabling echo mode in channels () 2023-04-12 11:09:06 +10:00
public DEV: Move discourse-chat to the core repo. () 2022-11-02 10:41:30 -03:00
spec FIX: prevents exception when publishing processed () 2023-04-16 10:30:33 +02:00
test/javascripts FIX: relies on native focus behavior in chat emoji picker () 2023-04-13 20:35:13 +02:00
plugin.rb FEATURE: Auto-remove users without permission from channel () 2023-03-22 10:19:59 +10:00
README.md DEV: Chat service object initial implementation () 2023-02-13 13:09:57 +01:00

This plugin is still in active development and may change frequently

Documentation

The Discourse Chat plugin adds chat functionality to your Discourse so it can natively support both long-form and short-form communication needs of your online community.

For user documentation, see Discourse Chat.

For developer documentation, see Discourse Documentation.