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

Make snapshot application communicative #135

Merged
merged 3 commits into from
Mar 20, 2019
Merged

Conversation

LPGhatguy
Copy link
Contributor

@LPGhatguy LPGhatguy commented Mar 15, 2019

This change is part of an ongoing effort to make Rojo deterministic, which makes it more robust as well as easier to test and debug.

Without this change, Rojo has nondeterministic child ordering once changes are applied to a running DOM, like in a live sync session. That means that restarting the Rojo server can result in a slightly different tree being presented, which has made snapshot testing a little bit sketchy.

The following things are deterministic with reordered change events either in master or with this change:

  • The order of in-memory filesystem nodes
  • The order of instances defined in a project
  • The order of children in snapshots
  • The order of children in RbxTree objects, now with patches

The following things still need to be modified to be deterministic in the face of patches being reordered:

  • The order of children in the Roblox DOM in the plugin
    • This is sort of tricky to do well
  • The order of properties being applied in the plugin
  • The order of properties being serialized in rbxmx, rbxlx, rbxm and rbxl files

TODO:

  • Publish new version of rbx_dom_weak that allows reordering of children

@LPGhatguy LPGhatguy marked this pull request as ready for review March 15, 2019 01:11
Copy link
Contributor

@ZoteTheMighty ZoteTheMighty left a comment

Choose a reason for hiding this comment

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

Forgot to comment before, but this looks good! Seems like a pretty straightforward way to do what you want.

@LPGhatguy LPGhatguy merged commit be094d5 into master Mar 20, 2019
@LPGhatguy LPGhatguy deleted the stable-child-order branch March 20, 2019 17:39
LPGhatguy added a commit that referenced this pull request Mar 20, 2019
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
* Add children sorting to snapshot_reconciler

* Update snapshot tests to include stable children order

* Bump dependencies, which should make this PR work
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
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