Skip to content

Fix Conflate Stale Rendering Logic for Short Circuit #1263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

steve-the-edwards
Copy link
Contributor

@steve-the-edwards steve-the-edwards commented Feb 12, 2025

When we kept rendering for CONFLATE_STALE_RENDERINGS we were not also checking if we should short circuit. We need to do both.

If any of the actions applied produces output from the root runtime though, then we will stop applying actions, update the rendering, and then send the output.

Short circuit if there is no changed state while conflating.
@steve-the-edwards steve-the-edwards changed the base branch from main to sedwards/fix-output-tests February 20, 2025 16:17
*/
suspend fun shortCircuitForUnchangedState(actionResult: ActionProcessingResult): Boolean {
if (runtimeConfig.contains(RENDER_ONLY_WHEN_STATE_CHANGES) &&
fun shouldShortCircuitForUnchangedState(actionResult: ActionProcessingResult): Boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new tongue-twister just dropped

@@ -183,34 +176,40 @@ public fun <PropsT, OutputT, RenderingT> renderWorkflowIn(
// launched.
var actionResult: ActionProcessingResult = runner.processAction()

if (shortCircuitForUnchangedState(actionResult)) continue
if (shouldShortCircuitForUnchangedState(actionResult)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better.

Base automatically changed from sedwards/fix-output-tests to main February 21, 2025 19:21
@steve-the-edwards steve-the-edwards merged commit 56e6ee0 into main Feb 21, 2025
31 checks passed
@steve-the-edwards steve-the-edwards deleted the sedwards/fix-conflate branch February 21, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants