Fix regression in producing sections when converting SlashCommandOutput to event stream (#20404)

Closes #20243 

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra authored and GitHub committed 2024-11-08 09:29:14 +01:00
1 parent 8cc3ce1f17
commit 2fe9cd8faa
6 files changed
+41 -60

No files matched your search

@@ -74,7 +74,7 @@ impl SlashCommand for StreamingExampleSlashCommand {
run_commands_in_text: false,
},
)))?;
events_tx.unbounded_send(Ok(SlashCommandEvent::EndSection { metadata: None }))?;
events_tx.unbounded_send(Ok(SlashCommandEvent::EndSection))?;
Timer::after(Duration::from_secs(1)).await;
@@ -89,7 +89,7 @@ impl SlashCommand for StreamingExampleSlashCommand {
run_commands_in_text: false,
},
)))?;
events_tx.unbounded_send(Ok(SlashCommandEvent::EndSection { metadata: None }))?;
events_tx.unbounded_send(Ok(SlashCommandEvent::EndSection))?;
for n in 1..=10 {
Timer::after(Duration::from_secs(1)).await;
@@ -105,8 +105,7 @@ impl SlashCommand for StreamingExampleSlashCommand {
run_commands_in_text: false,
},
)))?;
events_tx
.unbounded_send(Ok(SlashCommandEvent::EndSection { metadata: None }))?;
events_tx.unbounded_send(Ok(SlashCommandEvent::EndSection))?;
}
anyhow::Ok(())