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

[embedlite-components] Make selection handling more robust. Fixes JB#58662 #94

Merged
merged 1 commit into from Oct 3, 2022

Conversation

rainemak
Copy link
Member

@rainemak rainemak commented Sep 2, 2022

When trying to copy to clipboard without selection following got triggered:

JavaScript error: chrome://embedlite/content/SelectionHandler.js,
line 310: TypeError: this._cache.selection is undefined

Fix: return early if no cache or selection.

On error case following got triggered:

JavaScript error: chrome://embedlite/content/SelectionHandler.js,
line 66: TypeError: aJson is undefined

Fix: have json argument in all this.sendAsync calls.

Signed-off-by: Raine Makelainen raine.makelainen@jolla.com

…58662

When trying to copy to clipboard without selection following got triggered:
> JavaScript error: chrome://embedlite/content/SelectionHandler.js,
> line 310: TypeError: this._cache.selection is undefined

Fix: return early if no cache or selection.

On error case following got triggered:
> JavaScript error: chrome://embedlite/content/SelectionHandler.js,
> line 66: TypeError: aJson is undefined

Fix: have json argument in all this.sendAsync calls.

Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com>
Copy link
Member

@vigejolla vigejolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@llewelld llewelld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also LGTM. I could reproduce the bug before (empty copies causing future link selections to fail), but couldn't reproduce it after.

I wondered if maybe it would make sense to call Content:SelectionCopied with succeeded = false in the early return case, but looking at WebView.qml there wouldn't be any point.

@rainemak rainemak merged commit 26c5df2 into master Oct 3, 2022
@rainemak rainemak deleted the jb58662 branch October 3, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants