Fix devtools timeout with Firefox 133 (#34602)

Signed-off-by: Jay Oster <jay@kodewerx.org>
This commit is contained in:
Jay Oster 2024-12-12 15:38:24 -08:00 committed by GitHub
parent f7e2ec3a0f
commit 53612dab90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<String>,
pub workers: Vec<String>,
@ -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
},
})
}
}