googleworkspace / apps-script-samples

Apps Script samples for Google Workspace products.
https://developers.google.com/apps-script
Apache License 2.0
4.49k stars 1.83k forks source link

Cursor Inspector sample does not work (cursor data doesn't refresh properly) #423

Closed davevanegdom closed 12 months ago

davevanegdom commented 12 months ago

Summary

The Cursor Inspector sample does not work out of the box after having followed the provided instructions.

Expected Behavior

The Cursor Inspector sample is supposed to live-update (or at least at very regular intervals) information about my cursor or selection and display this information in a sidebar. Whenever the user moves the cursor or changes selection, the displayed information would update accordingly within a reasonable amount of time.

Sample URL: https://github.com/googleworkspace/apps-script-samples/tree/master/docs/cursorInspector Description: Cursor Inspector is a sample script for Google Docs that allows you to inspect the current state of the cursor or selection within a document. The information is presented in a sidebar and updates automatically every few seconds. The data presented corresponds with the Cursor and Selection classes of the API.

Actual Behavior

Upon opening the document, the sidebar displays the correct information from the cursor/selection. However, this information is not refreshed whenever the cursor or selection changes after this initialization. It does not seem to refresh on the defined time intervals.

Stopping and resuming the data refreshing using the provided button only refreshes the data once, akin to the initialization. It proceeds to NOT update cursor information after.

Steps to Reproduce the Problem

  1. Open the provided sample document.
  2. Follow the provided instructions in the copy of the sample document.
  3. Change cursor position/selection after the Cursor Inspector has initialized
jpoehnelt commented 12 months ago

Looks like a http/https issue. see change in https://github.com/googleworkspace/apps-script-samples/commit/89f968589bba0 to get it working again. It might be a bit before I can update the linked document.

davevanegdom commented 12 months ago

Hi!

Just wanted to let you know that this indeed resolved the issue, thank you so much for the help!