Skip to content

Conversation

@MichalPawlicki
Copy link
Contributor

@MichalPawlicki MichalPawlicki commented Mar 17, 2025

Proposed Changes

Fix the bugs that sometimes occur during the extraction of extensions.

Reason for Changes

The library:

  • Returns unexpected results for some SB3 projects: if the extensions field in an SB3 project JSON is an object, then extensions.count in the analysis result is undefined.
  • Fails with an unhandled error when the info field is missing from an SB2 project JSON.

scratch-parser doesn't enforce the presence or shape of the extensions field in the SB3 schema, or info in the SB2 schema, so scratch-analysis has to check these values itself.

Test Coverage

  • Unit tests.

@MichalPawlicki MichalPawlicki marked this pull request as ready for review March 17, 2025 16:32
@MichalPawlicki MichalPawlicki requested a review from cwillisf March 17, 2025 16:33
Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

These workarounds seem reasonable. Seems like we should add some/more logic in scratch-parser for these fields, but I guess we'd want more thorough testing for that considering how widely we use scratch-parser...

@MichalPawlicki MichalPawlicki merged commit 3f3cb21 into scratchfoundation:develop Mar 18, 2025
1 check passed
@MichalPawlicki MichalPawlicki deleted the fix-extensions-bugs branch March 18, 2025 10:11
@cwillisf cwillisf mentioned this pull request Mar 18, 2025
@github-actions
Copy link

🎉 This PR is included in version 2.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants