-
Notifications
You must be signed in to change notification settings - Fork 22
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
Comments
Deprioritizing because we haven't seen users encountering issue in awhile |
The issue only exists when we inadvertently delay the However, what can we do to avoid it in the future? Example:
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? |
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.
IIRC, they should be because of the top-level rejection handler |
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) |
This issue is no longer relevant because we're getting all permissions up-front |
Context
Discussion/Hypotheses
pixiebrix-extension/src/pageEditor/panes/save/useRecipeSaver.ts
Line 139 in f4d8b80
Workaround
Related Tickers
The text was updated successfully, but these errors were encountered: