Skip to content

try to validate assets before committing them#10480

Merged
riknoll merged 1 commit intomasterfrom
dev/riknoll/validate-assets2
Apr 11, 2025
Merged

try to validate assets before committing them#10480
riknoll merged 1 commit intomasterfrom
dev/riknoll/validate-assets2

Conversation

@riknoll
Copy link
Member

@riknoll riknoll commented Apr 2, 2025

this is me throwing spaghetti at the wall to prevent the weird asset disappearing bug from breaking projects. i still have no repro for that bug, but this change just puts in some common-sense checks to make sure that we don't ever overwrite assets with obviously invalid ones.

again, because i can't repro the actual issue, i'm not sure that this will actually fix anything. it's possible that when that bug occurs all of the assets get overwritten with perfectly valid transparent assets or all of the assets are just summarily deleted from the project. but the project in this comment at least has an invalid tilemap (it has a tile width of 0) so maybe this would have prevented that one specific problem. we'll see if that tick i added actually gets hit.

@riknoll riknoll requested a review from a team April 2, 2025 21:49
}


function set16Bit(buf: Uint8ClampedArray, offset: number, value: number) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this function supposed to be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, it wasn't used

Copy link
Contributor

@eanders-ms eanders-ms left a comment

Choose a reason for hiding this comment

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

LGTM

@riknoll riknoll merged commit 1c5d427 into master Apr 11, 2025
7 checks passed
@riknoll riknoll deleted the dev/riknoll/validate-assets2 branch April 11, 2025 22:44
microbit-grace pushed a commit to microbit-matt-hillsdon/pxt that referenced this pull request Apr 16, 2025
riknoll added a commit that referenced this pull request Apr 17, 2025
* try to validate assets before committing them (#10480)

* fix temporary asset ids when converting to named assets (#10507)

* fix temporary asset ids when they're named

* Update pxteditor/monaco-fields/field_tilemap.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix copilot typing error

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants