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

Serialize variable IDs in procedure definitions #1644

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

rachel-fenichel
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

Fixes #1642

Proposed Changes

Serialize and deserialize variable IDs for arguments in procedure definitions.

Reason for Changes

image

Dragging this block from the toolbox into the workspace failed.

The initial XML had no variable IDs, so the code to load the blocks in the flyout created a potential variable for "list" (and another potential variable for "x").

Dragging from the flyout to the workspace uses blockToDom, then domToBlock.

The serialization of the procedure definition block and its mutation did not include a variable ID, so a new variable was created (with a new ID).

The serialization of the "list" reference in the inner blocks did include a variable ID, which was the ID of the potential variable in the flyout.

This ID did not match the new ID of the parameter, so there was a crashing error.

Test Coverage

Tested on:

  • Desktop Chrome

Additional Information

Dragged in the above block from the flyout.

@rachel-fenichel rachel-fenichel merged commit c4d114e into google:develop Feb 20, 2018
@rachel-fenichel
Copy link
Collaborator Author

I'm also going to cherry-pick this into the release.

@rachel-fenichel rachel-fenichel deleted the bugfix/1642 branch February 21, 2018 21:06
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