Closed imsnif closed 3 years ago
@imsnif not sure why the tests failed in the pr, everything seems fine on my machine.
@tlinford - the tests also passed a few times for me locally. I re-ran them in the CI now, but this is a little concerning... could be that we introduced an extra render here and there's a race condition?
All that was added here was two calls to update_tabs
, as far as I can see that should only cause some PluginInstruction::Update
to be sent to the plugins?
I need to go afk now so can't check, but it's worth checking if those calls add an additional Render
down the line. If so it might be a race.
You are right, there are some additional calls to render down the line, I think because when PluginInstruction::Update
is handled and plugins are updated, ScreenInstruction::Render
is sent from zellij-server/src/wasm_vm.rs
.
Don't really get what happened in the failed test run though.
Ideally I'd like to avoid adding more renders. We might need to rethink some of the update_tabs
flow if it causes more renders than needed. Ideally I'd like things to be:
But we don't live in an ideal world :)
Do you think we can achieve this without adding extra renders somehow?
In this case, as a workaround, I think we can skip the screen.render()
after screen.update_tabs()
, since we know that update_tabs() will update plugins, and after that a render is always requested by wasm_vm
.
Sounds good. Will have to play with it a little to make sure there isn't some edge case the tests don't cover that is harmed by this.
cool, I pushed the changes and the tests ran fine, and I'm seeing the expected behavior locally.
Looks great, thanks!
To reproduce: