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 panic with new workspaces #131

Merged
merged 4 commits into from
Jul 7, 2023
Merged

Conversation

luca-della-vedova
Copy link
Member

Bug fix

Fixed bug

Fixes #130.

Fix applied

The fix is reasonably straightforward, just change the Default implementation of sites to have a new empty level. I'm not 100% sure putting a site ID of 0 is sound, and whether this would create any issue if we had multiple workspaces open

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova luca-della-vedova changed the title Fix panic with workspaces Fix panic with new workspaces May 22, 2023
@mxgrey
Copy link
Collaborator

mxgrey commented May 23, 2023

I don't think this is the way we should fix the issue. rmf_site_format is meant to be used by more than the editor GUI. It's also meant for use by scripts or other programs which may be surprised when a default initialization of a site gets automatically filled with exactly one level.

If anything, I think we should modify this code to create a default (empty) site and add one level before we dispatch it to load_site.

This reverts commit 9717a2a.

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova
Copy link
Member Author

I don't think this is the way we should fix the issue. rmf_site_format is meant to be used by more than the editor GUI. It's also meant for use by scripts or other programs which may be surprised when a default initialization of a site gets automatically filled with exactly one level.

If anything, I think we should modify this code to create a default (empty) site and add one level before we dispatch it to load_site.

Alright! Reverted the original fix and changed at the event sending level 2be0863
Added a Default derive for Level as well, all the fields implement default anyway so that helps reducing boilerplate

Copy link
Member

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

Works for me!

@luca-della-vedova luca-della-vedova merged commit b5b5ab6 into main Jul 7, 2023
5 checks passed
@luca-della-vedova luca-della-vedova deleted the luca/empty_world_panic branch July 7, 2023 04:52
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.

Clicking on Create->Lane in an empty world causes editor to panic.
3 participants