- 
                Notifications
    You must be signed in to change notification settings 
- Fork 70
Allow sprites named stage #50
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
Allow sprites named stage #50
Conversation
run sb3 files in the fixtures directory when running integration stress test
| @picklesrus and I discovered an issue with saving/loading a project from 2.0 where a sprite was named 'stage'. Turns out that we can reproduce this error (completely separate from 2.0) where naming a sprite 'stage' or 'Stage' in the 3.0 editor does not allow save/load because the sb3 fails validation. This fix will need to be deployed to scratch-projects and scratch-analysis (in addition to being updated in scratch-vm). | 
| Hmmm for some reason commit lint is failing on travis (but running  It looks like this is a problem with the node version. Switching to node 11 locally and running  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about _stage_
        
          
                lib/sb3_definitions.json
              
                Outdated
          
        
      | "name": { | ||
| "type": "string", | ||
| "not": {"enum": ["Stage", "stage"]} | ||
| "type": "string" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should validation not fail if you try to name a sprite _stage_, or is that handled elsewhere?
| "type": "string" | |
| "type": "string" | |
| "not": {"enum": ["_stage_"]} | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joker314, good catch! It looks like both the 2.0 and 3.0 editors prevent renaming a sprite to _stage_ so that should be included in the validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that @joker314.
add test fixture and unit test for this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. It would be nice to test the error condition with a test fixture that has a sprite called _stage_, but other than that I think this is good to go.
        
          
                lib/sb3_definitions.json
              
                Outdated
          
        
      | "name": { | ||
| "type": "string", | ||
| "not": {"enum": ["Stage", "stage"]} | ||
| "type": "string" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that @joker314.
| @thisandagain, added the fix that @joker314 suggested and added a test fixture in the invalid sub directory for it. I also updated the commitlint package (verifying locally that it works with both node 8 and 11), so now the build is not failing on travis anymore. | 
| 🎉 This PR is included in version 4.3.3 🎉 The release is available on: Your semantic-release bot 📦🚀 | 
Resolves #49 which was causing save/load failures for 2.0 and 3.0 projects.