From 53612dab90d08edc6ee3ba2856628c599a07fd83 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Thu, 12 Dec 2024 15:38:24 -0800 Subject: [PATCH] Fix devtools timeout with Firefox 133 (#34602) Signed-off-by: Jay Oster --- components/devtools/actors/root.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/components/devtools/actors/root.rs b/components/devtools/actors/root.rs index d6a4f2e4edd..a252255f52e 100644 --- a/components/devtools/actors/root.rs +++ b/components/devtools/actors/root.rs @@ -115,6 +115,13 @@ struct GetProcessResponse { process_descriptor: ProcessActorMsg, } +#[derive(Serialize)] +struct ErrorResponse { + from: String, + error: String, + message: String, +} + pub struct RootActor { pub tabs: Vec, pub workers: Vec, @@ -249,7 +256,19 @@ impl Actor for RootActor { ActorMessageStatus::Processed }, - _ => ActorMessageStatus::Ignored, + _ => { + let reply = ErrorResponse { + from: self.name(), + error: "unrecognizedPacketType".to_owned(), + message: format!( + "Actor {} does not recognize the packet type '{}'", + self.name(), + msg_type, + ), + }; + let _ = stream.write_json_packet(&reply); + ActorMessageStatus::Ignored + }, }) } }