Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"This function must be called during a user gesture" error on save in Page Editor #4019

Closed
twschiller opened this issue Aug 13, 2022 · 5 comments
Labels
bug Something isn't working user experience Improve the user experience (UX)

Comments

@twschiller
Copy link
Contributor

twschiller commented Aug 13, 2022

Context

Discussion/Hypotheses

Workaround

  • On the Blueprints Screen click the grant permission button (if it's showing)

Related Tickers

@twschiller twschiller added bug Something isn't working user experience Improve the user experience (UX) labels Aug 13, 2022
@twschiller twschiller added this to the 1.7.5 milestone Aug 13, 2022
@twschiller twschiller self-assigned this Aug 16, 2022
@twschiller twschiller modified the milestones: 1.7.5, 1.7.X Aug 18, 2022
@twschiller twschiller removed their assignment Aug 18, 2022
@corinnemayans corinnemayans added the next Good candidate for 30% time label Oct 19, 2022
@corinnemayans corinnemayans removed this from the 1.7.X milestone Oct 19, 2022
@twschiller twschiller removed the next Good candidate for 30% time label Oct 19, 2022
@twschiller
Copy link
Contributor Author

Deprioritizing because we haven't seen users encountering issue in awhile

@twschiller twschiller removed the triage label Oct 19, 2022
@fregante
Copy link
Contributor

The issue only exists when we inadvertently delay the permissions.request call, technically it was fixed.

However, what can we do to avoid it in the future? Example:

  • wrap the request API in a event handler
  • expose the API exclusively through the handler

This would let us set up early notifications if the API is called "too close to the timeout":

<Button onClick={permissionHandler(async (request) => {
	await whateverLongRunningTask();
	await request(permissions); // `console.warn('request was called 1000ms after the click handler, reduce this delay to avoid #4019')
})}>

Also are these errors already automatically reported?

@twschiller
Copy link
Contributor Author

However, what can we do to avoid it in the future?

I think that approach is reasonable. It would still be hard to catch introducing a delay during PR review though, as it would depend on the timing.

Also are these errors already automatically reported?

IIRC, they should be because of the top-level rejection handler

@fregante
Copy link
Contributor

Just thought of this: must we set the permission on "Save"?

We already have a dedicated "Grant permission" button that does one thing and will never cause this issue.

Another problem with the current situation is that a permission will be requested every time the user saves the brick, even if they reject it or don't need it (think contextMenu and the like)

@twschiller
Copy link
Contributor Author

This issue is no longer relevant because we're getting all permissions up-front

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user experience Improve the user experience (UX)
Projects
None yet
Development

No branches or pull requests

3 participants