Skip to content
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

fix: Update publishing details on flow change #3870

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 29, 2024

Please see https://opensystemslab.slack.com/archives/C01E3AC0C03/p1730197158271359

What's the problem?

  • The "last published" text does not update on flow change
  • The diff count badge does not update on flow change

What's the solution

  • Add flowId to the dependency arrays of the functions responsible for updating these values
  • This likely wasn't an issue in the past pre-route fixes and the component was always re-rendering - now that's not the case


const _validateAndDiffRequest = useAsync(async () => {
const newChanges = await validateAndDiffFlow(flowId);
setAlteredNodes(
newChanges?.data.alteredNodes ? newChanges.data.alteredNodes : [],
);
});
}, [flowId]);
Copy link
Contributor Author

@DafyddLlyr DafyddLlyr Oct 29, 2024

Choose a reason for hiding this comment

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

Technically this should update each time there's an operation on the current flow or any nested flow, but I think this would be calling this expensive API call a lot more than we want to.

Having it update once when navigating into a flow feels fine as a fix for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Neat :)

@DafyddLlyr DafyddLlyr requested a review from a team October 29, 2024 13:50
Copy link

github-actions bot commented Oct 29, 2024

Removed vultr server and associated DNS entries


const _validateAndDiffRequest = useAsync(async () => {
const newChanges = await validateAndDiffFlow(flowId);
setAlteredNodes(
newChanges?.data.alteredNodes ? newChanges.data.alteredNodes : [],
);
});
}, [flowId]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat :)

@DafyddLlyr DafyddLlyr merged commit 0864f48 into main Oct 29, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/update-publish-details-on-flow-change branch October 29, 2024 14:23
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.

2 participants