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

Placeholder prompt sometimes fails to paste clipping #233

Closed
aecreations opened this issue Oct 19, 2018 · 7 comments
Closed

Placeholder prompt sometimes fails to paste clipping #233

aecreations opened this issue Oct 19, 2018 · 7 comments

Comments

@aecreations
Copy link
Owner

Clippings 6.0.6 and 6.1b1+

Steps to repro:

  1. Create a clipping with two (2) placeholders. The first one should be a placeholder with multiple values; the second should be a normal placeholder
  2. Open a web page in the browser that has a textbox
  3. Right-click on the textbox in the web page and select the above clipping from the Clippings submenu
  4. In the placeholder prompt that appears, select/enter values then click OK

Result:
Clipping does not get pasted into the textbox. This happens sporadically. Possible explanation: the placeholder prompt window is closed before it has a chance to send a message back to the browser window to perform the placeholder substitution and paste the clipping.

Also, when the placeholder prompt window appears, the following error is displayed in the browser console:

 $(...)[0].select is not a function .................... placeholderPrompt.js:99

However, this error may not be related to the clipping paste failure.

@aecreations aecreations self-assigned this Oct 19, 2018
@aecreations aecreations added this to the 6.1b3 milestone Oct 23, 2018
@aecreations aecreations added this to To Do in Clippings 6.1 Oct 23, 2018
@aecreations aecreations modified the milestones: 6.1b3, 6.1b2 Oct 23, 2018
@aecreations aecreations moved this from To Do to In Progress in Clippings 6.1 Oct 25, 2018
@aecreations
Copy link
Owner Author

I've discovered that this isn't anything to do with the placeholder prompt closing before it has a chance to send a response to the browser window. Looking at the debugging log, the cause appears to be that the content script is not responding to the paste-clipping message that is sent to it to paste the clipping with placeholders:

Clippings/wx: Received message "paste-clipping-with-plchldrs" ... background.js:1744:24
Clippings/wx: Received message "close-placeholder-prmt-dlg" ... background.js:1744:24
Clippings/wx: Extension sending message "paste-clipping" to content script ... background.js:1744:24
Clippings/wx: pasteProcessedClipping(): Failed to paste clipping with placeholders: Error: Could not establish connection. Receiving end does not exist.

I'm able to reproduce this a few times. Strangely enough, it doesn't occur when pasting a clipping without any placeholders in its content.

@aecreations
Copy link
Owner Author

The active tab ID (i.e. the tab where the paste-clipping message is going to) is a different value when the paste fails. I suspect that what's happening is that the placeholder prompt window still has the focus for a very brief time before it closes, and the background script is executing the pasteProcessedClipping() function at the brief moment when the placeholder prompt window is still open.

This would explain why this issue isn't occurring when pasting a clipping without placeholders.

The only proper solution around this problem is to avoid opening a window when pasting a clipping with placeholders. One possibility is to inject a script into the current web page to display an inline HTML modal dialog on the page, prompting for the placeholder for the clipping to be pasted.

@aecreations
Copy link
Owner Author

Deferring this issue.

@aecreations aecreations removed this from the 6.1b2 milestone Oct 27, 2018
@aecreations aecreations moved this from In Progress to To Do in Clippings 6.1 Oct 27, 2018
@aecreations aecreations added this to the 6.1b2 milestone Oct 28, 2018
@aecreations aecreations moved this from To Do to In Progress in Clippings 6.1 Oct 28, 2018
aecreations added a commit that referenced this issue Oct 28, 2018
(issue #233)
- Fix also applied to keyboard paste prompt
@aecreations aecreations moved this from In Progress to Done in Clippings 6.1 Oct 28, 2018
@aecreations aecreations added this to To Do in Clippings 6.0.x Oct 29, 2018
@aecreations
Copy link
Owner Author

Fixed in 6.1b2. This bug fix is planned to be backported to 6.0.7.

@aecreations aecreations modified the milestones: 6.1b2, 6.0.7 Nov 2, 2018
aecreations added a commit that referenced this issue Nov 2, 2018
(issue #233)
- Fix also applied to keyboard paste prompt
@LeLake
Copy link

LeLake commented Dec 17, 2018

Hi there, odd thing happens with Linux kernel 3.10.0-957.1.3.el7.x86_64:

kernel-3.10.0-327.28.3.el7.x86_64 <--------- Clippings work like a charm
kernel-3.10.0-957.1.3.el7.x86_64 <--------- placeholder issue reappeared

similar behaviour described in this very BUG...
clippings with placeholder don't get pasted into the textbox, but those without the placeholder do get pasted.

Please let me know how I could help with logs or stuff...

Cheers!

@aecreations
Copy link
Owner Author

What version of Clippings and Firefox are you using?

When this issue occurs, copy any errors that appear in the Browser Console and paste them here.

Also, I would like information on the clipping containing the placeholders when this issue occurs. How many placeholders? Is the first placeholder normal text or has multiple values, the second placeholder, etc.?

@LeLake
Copy link

LeLake commented Jan 24, 2019

Sorry for the delay... so here it is.. I hope it helps:

Q: What version of Clippings and Firefox are you using?

  • Clippings 6.1.2

  • Firefox
    60.4.0esr (64-bit)
    Mozilla Firefox for Red Hat Enterprise Linux
    redhat - 1.0

  • JAVA
    openjdk version "1.8.0_191"
    OpenJDK Runtime Environment (build 1.8.0_191-b12)
    OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

  • JAVAWS
    icedtea-web 1.7.1 (rhel-1.el7-x86_64)

  • Kernel
    Linux xxxx-linux 3.10.0-957.1.3.el7.x86_64 [clipman] On Mac OS X, menu items in Find Bar scope menu are not toggling correctly #1 SMP Mon Nov 26 17:43:08 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

Q: When this issue occurs, copy any errors that appear in the Browser Console and paste them here.

  • open a new tab (google.com):

NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIInterfaceRequestor.getInterface] network-monitor.js:308

  • Click on google's search textbox:

LoginRecipes:getRecipes: falling back to a synchronous message for: "https://www.google.com" LoginRecipes.jsm:243
Attempt to set a forbidden header was denied: Connection 627227574-lcs_client_bin.js:134:386

  • right click and select my clipping (tested on one and three placeholders like "$[Name]", exact same logs with placeholder+value as "$[Name{Team}]")

  • click on clippings textbox:

Key event not available on some keyboard layouts: key=“r” modifiers=“accel,alt” id=“key_toggleReaderMode” browser.xul
Key event not available on some keyboard layouts: key=“i” modifiers=“accel,alt,shift” id=“key_browserToolbox” browser.xul
Attempt to set a forbidden header was denied: Connection 627227574-lcs_client_bin.js:134:386

  • click on ok button:

[Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://gre/modules/ExtensionUtils.jsm :: sendAsyncMessage :: line 533" data: no] (unknown)
sendAsyncMessage resource://gre/modules/ExtensionUtils.jsm:533:51
_handleMessage/deferred.promise< resource://gre/modules/MessageChannel.jsm:984:9

NOTE: When using a clipping without any placeholder, no events are registered by the Browser console, and the clipping is pasted in to the textbox.

Q: Also, I would like information on the clipping containing the placeholders when this issue occurs. How many placeholders?
Answered in the steps above

Q: Is the first placeholder normal text or has multiple values, the second placeholder, etc.?
A: All of my placeholders are "text" only ($[])

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants