fix(plugins): make sure to always render on first resize (#3693)

* fix(plugins): make sure to always render on first resize

* style(fmt): rustfmt

* fix tests
This commit is contained in:
Aram Drevekenin 2024-10-24 08:46:16 +02:00 committed by GitHub
parent f36dccfe39
commit 53215e6228
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 14 deletions

View File

@ -693,12 +693,8 @@ impl<'a> PluginLoader<'a> {
.try_into()
.map_err(|e| anyhow!("Failed to serialize user configuration: {:?}", e))?;
let protobuf_bytes = protobuf_plugin_configuration.encode_to_vec();
wasi_write_object(
plugin.lock().unwrap().store.data(),
&protobuf_bytes,
// &self.plugin.userspace_configuration.inner(),
)
.with_context(err_context)?;
wasi_write_object(plugin.lock().unwrap().store.data(), &protobuf_bytes)
.with_context(err_context)?;
load_function
.call(&mut plugin.lock().unwrap().store, ())
.with_context(err_context)?;

View File

@ -695,7 +695,7 @@ pub fn load_new_plugin_from_hd() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
1,
2,
&PermissionType::ChangeApplicationState,
cache_path,
plugin_thread_sender,
@ -775,7 +775,7 @@ pub fn load_new_plugin_with_plugin_alias() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
1,
2,
&PermissionType::ChangeApplicationState,
cache_path,
plugin_thread_sender,
@ -851,7 +851,7 @@ pub fn plugin_workers() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
2,
3,
&PermissionType::ChangeApplicationState,
cache_path,
plugin_thread_sender,
@ -931,7 +931,7 @@ pub fn plugin_workers_persist_state() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
4,
5,
&PermissionType::ChangeApplicationState,
cache_path,
plugin_thread_sender,
@ -5952,7 +5952,7 @@ pub fn unblock_input_plugin_command() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
1,
2,
&PermissionType::ReadCliPipes,
cache_path,
plugin_thread_sender,
@ -6034,7 +6034,7 @@ pub fn block_input_plugin_command() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
1,
2,
&PermissionType::ReadCliPipes,
cache_path,
plugin_thread_sender,
@ -6207,7 +6207,7 @@ pub fn pipe_message_to_plugin_plugin_command() {
received_screen_instructions,
ScreenInstruction::PluginBytes,
screen_receiver,
2,
3,
&PermissionType::ReadCliPipes,
cache_path,
plugin_thread_sender,

View File

@ -615,7 +615,9 @@ impl WasmBridge {
running_plugin.rows = new_rows;
running_plugin.columns = new_columns;
if old_rows != new_rows || old_columns != new_columns {
// in the below conditional, we check if event_id == 0 so that we'll
// make sure to always render on the first resize event
if old_rows != new_rows || old_columns != new_columns || event_id == 0 {
let rendered_bytes = running_plugin
.instance
.clone()