Skip to content

More fixes for broken updates #3217

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 1 commit into from
Mar 28, 2024
Merged

More fixes for broken updates #3217

merged 1 commit into from
Mar 28, 2024

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Mar 27, 2024

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

Follow up of #3205.

What is the current behavior?

The new update model is still not fool proof. Mostly updates coming from changes in the model are not always reflected in the diagrams.

The main issue is that I'd like to batch updates, but those update do have to happen within the context of the current transaction. Ergo, they can not happen completely asynchronous (as was the case previously).

Just requesting an update is not enough.

This is now solved by updating directly after an update request is done. This has the possible risk of doing double work. However, it's our only guarantee at the moment to make sure the diagrams are up to date.

Issue Number: N/A

What is the new behavior?

The request_update() methods still schedule a diagram item for an update. The update now happens when a transaction is committed.

To ensure that the transaction is not closed directly, the Undo Manager schedules a new event to close the commit.

This only works when working with diagrams interactively. If diagrams are changed programmatically, Diagram.update() needs to be called explictly.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

  • Removed some redundant update requests.

@amolenaar amolenaar marked this pull request as draft March 27, 2024 14:09
@amolenaar amolenaar changed the title Broken updates More fixes for broken updates Mar 27, 2024
@github-actions github-actions bot added the python Pull requests that update Python code label Mar 27, 2024
@amolenaar amolenaar force-pushed the broken-updates branch 2 times, most recently from fb80c18 to 3ff9c23 Compare March 28, 2024 07:55
Instead of handling diagram updates when the views need a rerender
(the old behavior), we update all diagrams before a transaction is
committed.
This ensures that diagram updates happen within the context of a
transaction.
@amolenaar amolenaar marked this pull request as ready for review March 28, 2024 23:03
@amolenaar amolenaar merged commit 2a85490 into main Mar 28, 2024
@amolenaar amolenaar deleted the broken-updates branch March 28, 2024 23:03
@danyeaw danyeaw added fix A fix for a bug and removed python Pull requests that update Python code labels Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants