microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
711 stars 585 forks source link

Crash in identity code after deleting script from the editor #3959

Closed pelikhan closed 3 years ago

pelikhan commented 3 years ago

image

image

abchatra commented 3 years ago

Hmm we don't have identity in microbit. Is this a microbit bug?

pelikhan commented 3 years ago

It happened in the microbit editor.


From: Abhijith Chatra @.> Sent: Thursday, April 8, 2021 3:40:30 AM To: microsoft/pxt-microbit @.> Cc: Peli de Halleux @.>; Author @.> Subject: Re: [microsoft/pxt-microbit] Crash in identity code after deleting script from the editor (#3959)

Hmm we don't have identity in microbit. Is this a microbit bug?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-microbit%2Fissues%2F3959%23issuecomment-815383987&data=04%7C01%7Cjhalleux%40microsoft.com%7Cd13baffec26c4ec66eef08d8fa2f4b60%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637534428323666125%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oea3by3kFmsd0oZB%2FeTXhBumR0fiU7EnQF1PRWc3sYY%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKI3AFEMOEPWBJTWIZLTHUCQ5ANCNFSM42QTWJBA&data=04%7C01%7Cjhalleux%40microsoft.com%7Cd13baffec26c4ec66eef08d8fa2f4b60%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637534428323666125%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=v2inT56DYXYO2%2FR43mbwrRrbAuWY%2FkwRyK2u96CFku8%3D&reserved=0.

darzu commented 3 years ago

Yes, it's crashing in cloud code before it gets to the "has identity" check. I need to move the guard forward so this doesn't happen

darzu commented 3 years ago

The crash happens b/c we're assuming "header" is not null in the editortoolbox.tsx's renderCore fn, it just happens the cloud code is the first that assumes this. I can't see a good reason why it should be able to be null but that's what we get for not using strictNullChecks.

darzu commented 3 years ago

@pelikhan , what's the repro? I tried:

  1. new JS project
  2. Add new file (custom.ts)
  3. Delete custom.ts in explorer
  4. no error..?
pelikhan commented 3 years ago

Import https://github.com/microsoft/pxt-jacdac Delete project from editor blank

pelikhan commented 3 years ago

Looks similar to https://github.com/microsoft/pxt-arcade/issues/3413