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: undoing and redoing parameter events #6721

Merged
merged 10 commits into from
Jan 6, 2023

Conversation

BeksOmega
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes #6040

Work on #6526

Proposed Changes

Fixes two bugs found with undo and redo and parameters:

  • Undoing and redoing creating a parameter would create duplicate parameters
  • Undoing and renaming parameters would fail with errors

Reason for Changes

Fixing bugs is fun!

Test Coverage

Added tests for undoing and redoing:

  • Adding parameters
  • Renaming parameters
  • Deleting parameters

Also changes a bunch of tests to properly tick the clock instead of calling compose or doing other things.

Documentation

N/A

Additional Information

Had to skip some tests for dealing with unnamed procedures, because once I fixed them to properly tick the clock, I found out they were broken. They are fixed in a follow-up PR.

Dependent on #6718

@BeksOmega BeksOmega changed the title fix: udoing and redoing parameter events fix: undoing and redoing parameter events Dec 22, 2022
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Dec 22, 2022
@BeksOmega BeksOmega marked this pull request as ready for review January 6, 2023 04:08
@BeksOmega BeksOmega requested a review from a team as a code owner January 6, 2023 04:08
@BeksOmega
Copy link
Collaborator Author

Unskipped the unnamed caller tests because after changes to #6718 these are no longer broken.

return null;
}
const params = this.getProcedureModel().getParameters();
if (!params.length && this.hasStatements_) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add undefined to the return type for this function

(nit because i'm not sure anything is currently checking/enforcing these types...?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah whoops, thanks for the catch. This actually needs to return null, not undefined!

@BeksOmega BeksOmega merged commit 23fb76b into google:develop Jan 6, 2023
@BeksOmega BeksOmega deleted the fix/parameter-events branch May 14, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undoing renaming a procedure parameter requires multiple undos
2 participants