pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Google Sheets File Picker not showing in Page Editor

Open twschiller opened this issue 3 years ago • 3 comments

Context

  • Observed on client call with @twschiller and @mthek10
  • When clicking "Select" sheet in Page Editor, the Google File Picker was not shown. The select button stays disabled
  • No errors in Page Editor console
  • No errors on gapi startup in Background Page (gapi initialized message was displayed)

Discussion

  • Brittany was experiencing problems with gapi where she had to reload the PixieBrix browser extension for calls to Google Sheets to work (requiring multiple reloads a day): https://pixiebrix.slack.com/archives/C02CN01JXAA/p1659400679658159

Related Code

twschiller avatar Jul 29 '22 03:07 twschiller

@BLoe FYI, was getting an error in 1.7.3-beta.1 when using the File Picker in the Extension Console: https://github.com/pixiebrix/pixiebrix-extension/issues/3794#issuecomment-1212520960

twschiller avatar Aug 11 '22 21:08 twschiller

Given that the onerror handler isn't producing useful output, what if we notify the user?

For example:

  1. onerror={() => gapiFailed = true} (or something more elegant, like await initGoogle())
  2. When trying to use the gapi, check this loading state and show a notification if it results into an error

This notification would:

  • give the user at least some feedback
  • prompt Brittany to check the console for further information regarding the load error (if it's in the editor, then she'd have to to open its dedicated console, not the page’s console)

This is advised because the browser may decide to stop a request for a few reasons but never tell us why programmatically; the dev tools may show CSP errors, plain connection errors, proxy errors, ad blockers, etc etc. while we get a plain Network Error

fregante avatar Sep 08 '22 19:09 fregante

gapi initialized message was displayed

This means that the script was loaded and it was initialized successfully. Since gapi.* method calls would throw if the script completely failed, I assume that the user is already probably notified when that happens.

Edit: from the screencast, it looks like it already happens. I don’t think we can get gapi initialized and also have gapi undefined in the same session.

fregante avatar Sep 10 '22 12:09 fregante

Notion spec for putting the GSheets bricks behind a GAPI loaded wall: https://www.notion.so/pixiebrix/Make-Google-Sheets-work-the-way-users-expect-041e91ede0d04a928d21b7bfe7f3482f?pvs=4#55601efc5d44410ba9f7af3b23f4424c

twschiller avatar Mar 29 '23 17:03 twschiller

Release 1.7.30 includes some fixes and telemetry for this issue. Closing this for now, and will re-open if we continue to see issues

twschiller avatar Jun 17 '23 13:06 twschiller