Desktop: Buffer web messages until connection is initialized (#3082)

Buffer web messages until connection is initialized
This commit is contained in:
Timon
2025-08-22 15:15:17 +00:00
committed by GitHub
parent a4ec50d8ba
commit c6ec3a27ca
9 changed files with 74 additions and 14 deletions
+5
View File
@@ -46,6 +46,7 @@ pub(crate) trait CefEventHandler: Clone {
/// Scheudule the main event loop to run the cef event loop after the timeout
/// [`_cef_browser_process_handler_t::on_schedule_message_pump_work`] for more documentation.
fn schedule_cef_message_loop_work(&self, scheduled_time: Instant);
fn initialized_web_communication(&self);
fn receive_web_message(&self, message: &[u8]);
}
@@ -145,6 +146,10 @@ impl CefEventHandler for CefHandler {
let _ = self.event_loop_proxy.send_event(CustomEvent::ScheduleBrowserWork(scheduled_time));
}
fn initialized_web_communication(&self) {
let _ = self.event_loop_proxy.send_event(CustomEvent::WebCommunicationInitialized);
}
fn receive_web_message(&self, message: &[u8]) {
let Some(desktop_wrapper_message) = deserialize_editor_message(message) else {
tracing::error!("Failed to deserialize web message");