feat(plugin): harden V4 host integration

Preserve legacy wire indices and route concurrent V4 responses and background requests by correlation and stable tab ID.
This commit is contained in:
Hakan Seven committed 2026-08-15 20:17:43 +03:00
commit f247d15f6e
110 files changed
+32159 -1254

No files matched your search

+15 -3
View File
@@ -27,7 +27,11 @@ macro_rules! vlog {
/// A frame delivered from the V4 reader thread to the host main thread.
pub enum HostIncoming {
Response { id: u64, payload: crate::ipc::protocol::HostResponse },
Request { id: u64, payload: Box<crate::ipc::protocol::PluginRequest> },
Request {
id: u64,
tab_id: Option<u64>,
payload: Box<crate::ipc::protocol::PluginRequest>,
},
}
/// Token-bucket rate limiter.
@@ -117,9 +121,17 @@ pub fn run_host_reader_thread(
}
}
}
Ok(PluginToHostV4::Request { id, payload }) => {
Ok(PluginToHostV4::Request {
id,
tab_id,
payload,
}) => {
if incoming
.send(HostIncoming::Request { id, payload: Box::new(payload) })
.send(HostIncoming::Request {
id,
tab_id,
payload: Box::new(payload),
})
.is_err()
{
break;