FIX: streaming related specs (#1448)
## 🔍 Overview This update fixes an issue where message bus streaming related specs were not working correctly. To do so we pass the `last_id` when subscribing to `MessageBus` which allows us to unskip those broken tests. --------- Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
@@ -85,14 +85,18 @@ export default class ModalDiffModal extends Component {
|
||||
|
||||
@bind
|
||||
subscribe() {
|
||||
this.messageBus.subscribe(CHANNEL, this.updateResult);
|
||||
this.messageBus.subscribe(
|
||||
CHANNEL,
|
||||
this.updateResult,
|
||||
this.currentUser
|
||||
?.discourse_ai_helper_stream_composer_suggestion_last_message_bus_id
|
||||
);
|
||||
}
|
||||
|
||||
@bind
|
||||
cleanup() {
|
||||
// stop all callbacks so it does not end up streaming pointlessly
|
||||
this.smoothStreamer.resetStreaming();
|
||||
this.diffStreamer.reset();
|
||||
this.#resetState();
|
||||
this.messageBus.unsubscribe(CHANNEL, this.updateResult);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user