This commit addresses an issue where temporary chat history was not being updated correctly when using voice input.
The `setHistoryId` function is now called within the `saveMessageOnError` function to ensure that the history ID is set correctly when a message is saved.