jsayol / vscode-firebase-explorer

Visual Studio Code extension to explore and manage your Firebase projects
https://devlibrary.withgoogle.com/products/firebase/repos/jsayol-vscode-firebase-explorer
MIT License
148 stars 22 forks source link

Firebase Hosting section throws error #8

Closed Kneemund closed 5 years ago

Kneemund commented 5 years ago

When does it occur?

As soon as I select my Firebase project. Turning hosting on or off makes no difference.

What happens?

VS Code throws an error message and nothing is displayed in the "Hosting" section. I'd expect a message telling me why nothing is displayed like everywhere else. The error is displayed in the notification area.

firebase_explorer

Error

full error message from VS dev tools

notificationsAlerts.ts:38 Error: Cannot read property 'status' of undefined
    at new Nt (C:\Users\[NAME]\.vscode\extensions\jsayol.firebase-explorer-0.2.9\dist\extension.js:441:41860)
    at module.exports.Mt.o.map.r (C:\Users\[NAME]\.vscode\extensions\jsayol.firebase-explorer-0.2.9\dist\extension.js:441:44261)
    at Array.map (<anonymous>)
    at Mt (C:\Users\[NAME]\.vscode\extensions\jsayol.firebase-explorer-0.2.9\dist\extension.js:441:44254)
    at process._tickCallback (internal/process/next_tick.js:68:7)
jsayol commented 5 years ago

Hi @NiemandTV, thanks for reporting this! I'm looking into it, I'll let you know what's up as soon as I figure it out :)

jsayol commented 5 years ago

I know where the error is, and it seems it's triggered because of a strange response from the Hosting API.

I just published a new version that should avoid this error, but in order to really figure this out I'm going to need some more information. Once the extension has updated for you (should be version 0.3.0) would you mind opening the dev tools and copying what's in there? Feel free to remove any identifyable information before you paste it here, I'm mostly interested in the shape of the object.

Kneemund commented 5 years ago

It's working as intended now :)

  {
  "name": "sites/[PROJECT-NAME]/releases/1554493521684419",
  "type": "SITE_DISABLE",
  "releaseTime": "2019-04-05T19:45:21.684419Z",
  "releaseUser": {
    "email": "[MYEMAIL]@gmail.com",
    "imageUrl": "https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5Mzsjl-tnux3Or10Jq7Df1ZwIhkKAW0Q____________ARjbsIj-______8B/photo.jpg"
  }
}
jsayol commented 5 years ago

Ohhh, I see what's going on! I didn't take into account the SITE_DISABLE type of releases. I didn't know that those didn't include a version (the API docs make no mention of it) but I guess it makes sense that they don't. I'll include some extra checks for this particular case.

Thanks for your help debugging this!

Kneemund commented 5 years ago

Sorry, maybe not completely. If I disable Firebase Hosting this error pops up:

/C:/Users/[NAME]/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2370 Error: Cannot read property 'name' of undefined
    at Gt (C:\Users\[NAME]\.vscode\extensions\jsayol.firebase-explorer-0.3.1\dist\extension.js:441:45483)
    at process._tickCallback (internal/process/next_tick.js:68:7)
onDidNotificationChange @ /C:/Users/[NAME]/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2370

Only redeploying fixes it.

jsayol commented 5 years ago

Huh, interesting. Going to look into it now.

jsayol commented 5 years ago

Fixed! I just published a new version (0.3.2) solving this.

I also improved how the SITE_DISABLE releases are handled now, so you should see a bit more information.