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

thunderlink: and cbthunderlink: not working #10

Closed
kgorlen opened this issue Nov 1, 2020 · 26 comments
Closed

thunderlink: and cbthunderlink: not working #10

kgorlen opened this issue Nov 1, 2020 · 26 comments

Comments

@kgorlen
Copy link

kgorlen commented Nov 1, 2020

Version 0.6.0, Windows 10 version 2004, Thunderbird 68.12.1, Google Chrome Version 86.0.4240.111

Successfully installed cb_thunderlink.xpi and cb_thunderlink_windows:

2020-11-01 12:59:07,495 - 12548 - INFO - 82 : ====================================================================================================
2020-11-01 12:59:07,496 - 12548 - INFO - 83 : Starting cb_thunderlink (['cb_thunderlink.exe', 'register'])
2020-11-01 12:59:07,499 - 12548 - INFO - 246 : Finishing cb_thunderlink
2020-11-01 12:59:07,500 - 12548 - INFO - 247 : ====================================================================================================

The add-on creates links, e.g.:

thunderlink://messageid=aade35ca-7d99-ab02-d224-91c3840b313b@comcast.net

cbthunderlink://MjAyMC0xMC0yOVQyMToyMDowMC4wMDBaO0tlaXRoIDxnb3JsZW5AY29tY2FzdC5uZXQ+

but these do not cause linked messages to open.

@vlcinsky
Copy link

vlcinsky commented Nov 1, 2020

There could be two types of reasons:

  • link: the link itself is broken
  • registration: the thunderlink/cthunderlink schema registration does not work

To test the link works, put the thunderlinks url (incl. the schema) into clipboard, go to Thunderbird and click the cb_thunderlink button. This should jump into the e-mail of interest. If it does not, the link is broken.

In my situation (Linux):

  • link for thunderlink is working
  • link for cb_thunderlink does not work
  • registration seems broken, but this might be a problem of my misunderstanding.

@kgorlen
Copy link
Author

kgorlen commented Nov 1, 2020 via email

@vlcinsky
Copy link

vlcinsky commented Nov 1, 2020

I can confirm, that (on Linux) pasting generated links into Firefox address line opens the e-mail in all cases.

So I guess in my case all works as expected, the only issue I have is to finetune emacs org-mode integration, which is likely to cause the issue.

@CamielBouchier
Copy link
Owner

@kgorlen , let me try to help. I have it working myself on Windows 10.

(i) I understand the cut/paste-into-thunderbird works perfectly, so it is not a matter of broken or wrong links, correct?
(ii) I understand you unpacked the cb_thunderlink_windows and have it somewhere permanently on your computer. I have it e.g. as c:\cb_thunderlink\...

If so, and hoping you have some regedit experience, can you search through your registry editor and cut/paste all entries that are thunderlink related?

Camiel B.

@CamielBouchier
Copy link
Owner

@vlcinsky,

(i) are you saying that on your linux cbthunderlink (without underscore!) is not working as a link into thunderbird? It should.
(ii) Registration on Linux I am far more unsure to have it right in a generic way. Most certainly not. If you share your distribution I can try to find out about registration for it.

Camiel B.

@kgorlen
Copy link
Author

kgorlen commented Nov 2, 2020 via email

@CamielBouchier
Copy link
Owner

@kgorlen , thanks for the feedback.

The quoting in the registry should be piece of cake. I will follow-up on that one.

Having a full installation in C:\Program Files ... is not that trivial (certainly if it also must be executed automatically).
Given that the workaround is rather trivial, I will consider but with low priority.

Camiel B.

@tekvsakdan
Copy link

tekvsakdan commented Nov 3, 2020

I have the same problem on Ubuntu 20.10. Thunderbird 78.3.2. cb_thunderlink 0.6.0.
thunderlink:// is working from Firefox (82.0), cbthunderlink:// is not working.
I can not make it work from Google Chrome (86.0.4240.183), none of is working.

Edit: I have found out some cbthunderlink:// links are working and some are not.

Edit2: The same message
WORKING xdg-open thunderlink://messageid=XY-t5oCfTI2TKr5Q8d334A@ismtpd0105p1iad2.xxxxxxx.net
NOT WORKING xdg-open cbthunderlink://MjAyMC0xMS0wM1QwMTowMTowMy4wMDBaOyJTdGFjayBPdmVyZmxvdyIgPGRvLW5vdC1yZXBseUBzdGFja292ZXJmbG93LmVtYWlsPg==

@CamielBouchier
Copy link
Owner

@tekvsakdan, probably I will have tomorrow some time to launch a VM on Ubuntu 20.10 to try and reproduce.

However, can you be as precise as possible:

(i) Does the cut/paste approach (i.e. cut the link from wherever and paste it using the button in thunderbird) work always? Or does it work only for thunderlink:// and never for cbthunderlink:// ?
(ii) If it does work for some cbthunderlink://, can you create a thunderlink:// from the same message it does not work for? I want to exclude it is a specific message it can't find. (might need a re-indexing then, I will explain)
(iii) If you enable in thunderbird the developer tools, is there appearing any message in the console that sheds some light?

Only if above is clear (and working) it makes sense for me starting to look into the integration and xdg-open etc.

Camiel B.

@tekvsakdan
Copy link

tekvsakdan commented Nov 3, 2020

I have found a button in Thunderbird. Here is the console.log.

Thunderlink working and cbthunderlink not working. The same message.

handle_incoming_link thunderlink://messageid=XY-t5oCfTI2TKr5Q8d334A@ismtpd0105p1iad2.sendgrid.net cb_background.js:231:13
WebExtensions: cb_show_message_from_msg_id XY-t5oCfTI2TKr5Q8d334A@ismtpd0105p1iad2.sendgrid.net new_tab cb_api.js:66
handle_incoming_link cbthunderlink://MjAyMC0xMS0wM1QwMTowMTowMy4wMDBaOyJTdGFjayBPdmVyZmxvdyIgPGRvLW5vdC1yZXBseUBzdGFja292ZXJmbG93LmVtYWlsPg== cb_background.js:231:13
Investigate me. the_message == null. ml: 
Object { id: null, messages: [] }
cb_background.js:271:21

Both working. The same message.

handle_incoming_link cbthunderlink://MjAyMC0xMS0wM1QwNDoyMjo0NS4wMDBaOzx6YWJiaXhAa2lzLnNpPg== cb_background.js:231:13
WebExtensions: cb_show_message_from_api_id 3 new_tab cb_api.js:40
handle_incoming_link thunderlink://messageid=8836eafd-0e6c-4630-b99e-79efa848a796@vsr-exch.kis-h2.si cb_background.js:231:13
WebExtensions: cb_show_message_from_msg_id 8836eafd-0e6c-4630-b99e-79efa848a796@vsr-exch.kis-h2.si new_tab 
cb_api.js:66```

@CamielBouchier
Copy link
Owner

@tekvsakdan Thanks for the input. It means there is really a problem with the core functionality, not with the integration. Just to be absolutely sure, in the first case both links point to the same message, correct? I will try to review the code guessing what might be wrong (I can't reproduce).

@CamielBouchier
Copy link
Owner

@tekvsakdan Sorry for my previous message, actually you confirmed it is the same message but I read it too fast as 'message in the console.log'. My mistake. I have the info I need for the moment.

Camiel B.

@CamielBouchier
Copy link
Owner

@tekvsakdan, can you help me for a moment? Can you close thunderbird and remove from the profile directory following file : global-messages-db.sqlite. Then you reopen thunderbird and observe for some time how that file rebuilds. With observe I mean that you wait until it does not grow anymore. Depending on your setup that can be minutes or hours. Once the global-messages-db.sqlite has been rebuilt completely, can you then try again?

Camiel B.

@tekvsakdan
Copy link

tekvsakdan commented Nov 4, 2020

After 4 hours of rebuilding global-messages-db.sqlite (300 MB), the first case scenario is still NOT OK. Thunderlink is working and cbthunderlink is not working. The 2nd case was OK.

handle_incoming_link thunderlink://messageid=XY-t5oCfTI2TKr5Q8d334A@ismtpd0105p1iad2.sendgrid.net cb_background.js:231:13
WebExtensions: cb_show_message_from_msg_id XY-t5oCfTI2TKr5Q8d334A@ismtpd0105p1iad2.sendgrid.net new_tab cb_api.js:66
handle_incoming_link cbthunderlink://MjAyMC0xMS0wM1QwMTowMTowMy4wMDBaOyJTdGFjayBPdmVyZmxvdyIgPGRvLW5vdC1yZXBseUBzdGFja292ZXJmbG93LmVtYWlsPg== cb_background.js:231:13
Investigate me. the_message == null. ml: 
Object { id: null, messages: [] }
cb_background.js:271:21
handle_incoming_link cbthunderlink://MjAyMC0xMS0wM1QwNDoyMjo0NS4wMDBaOzx6YWJiaXhAa2lzLnNpPg== cb_background.js:231:13
WebExtensions: cb_show_message_from_api_id 3 new_tab cb_api.js:40
handle_incoming_link thunderlink://messageid=8836eafd-0e6c-4630-b99e-79efa848a796@vsr-exch.kis-h2.si cb_background.js:231:13
WebExtensions: cb_show_message_from_msg_id 8836eafd-0e6c-4630-b99e-79efa848a796@vsr-exch.kis-h2.si new_tab 
cb_api.js:66

@CamielBouchier
Copy link
Owner

@tekvsakdan, again thanks for your feedback. I would be glad helping you but as I currently cannot reproduce I have to help through code reading and guessing ...

Any chance there are preferred folders or to-be-avoided folders defined in the settings? Anything else that can shed some light?

If you use the thunderbird mechanism to search for the message using date and author (2020-11-03T01:01:03.000Z;"Stack Overflow" do-not-reply@stackoverflow.email), does it work?

Camiel B.

@tekvsakdan
Copy link

tekvsakdan commented Nov 5, 2020

This search does not work :(
2020-11-03T01:01:03.000Z;"Stack Overflow" do-not-reply@stackoverflow.email

I have 3 different mail accounts. 2 of them are Exchange via IMAP and 1 of them is gmail account with custom domain (I'm hosting my domain on Google) via IMAP. I guess it is the same if you have free gmail account. cbthunderlink:// is working fine with exchange accounts, on the other hand, it does not work with (custom domain) gmail account. My conclusion is that gmail messages are treated differently than exchange.

EDIT: No, my conclusion is not correct. After I wrote this comment I have found some cbthunderlink:// in gmail account are working. Half of the messages are working and half are not working.

@CamielBouchier
Copy link
Owner

@tekvsakdan

(i) "does not work" means that you did use manually the thunderbird search capabilities to search for a message with that date and that sender?

(ii) gmail is likely not the problem. In fact I am working mostly on a gmail account without any issues.

I have some hunch it might be related to date/time issues, but the search in (i) might clarify that. Or not ...

Camiel B.

@tekvsakdan
Copy link

tekvsakdan commented Nov 5, 2020

If I put this in search is not working.
2020-11-03T01:01:03.000Z;"Stack Overflow" do-not-reply@stackoverflow.email
If I put without semicolon it works
2020-11-03T01:01:03.000Z "Stack Overflow" do-not-reply@stackoverflow.email

EDIT: Sorry. It found out your message from github. I'm too quick sometimes. The search doesn't find the correct message.

@CamielBouchier
Copy link
Owner

@tekvsakdan that is weird ... moreover I am not sure to follow exactly what you did and what are the results.

Maybe a small reset that helps you debugging the issue.

cbthunderlink works by finding messages on the combination 'message.author' and 'message.date'. Both are base64 encoded in the cbthunderlink. So if thunderbird itself, using its own search capabilities, would not be finding the message with correct author and date, then cbthunderlink won't either. Of course there is still the possibility that cbthunderlink, when generating the link, picked up a wrong date or author.

So the link you have problems with has base64 encoded : 2020-11-03T01:01:03.000Z;"Stack Overflow" do-not-reply@stackoverflow.email. Are these actually the correct data for the message to be found? In that case, thunderbird should find it in 'manual search mode' as well. What has the message in its headers?

Camiel B.

@tekvsakdan
Copy link

SELECT a.c1subject AS "SUBJECT",
       a.c3author AS "FROM",
       a.c4recipients AS "TO",
       b.date,
       c.folderURI AS "FOLDER_LOCATION",
       c.name AS "FOLDER_NAME"       
    FROM messagesText_content a
    INNER JOIN messages b ON a.docid=b.id
    INNER JOIN folderLocations c ON b.folderID=c.id
    WHERE a.c1subject LIKE ('1 new item in your Stack Exchange inbox%');

The result is:
DATE=1604365263000000
FROM="Stack Overflow" <do-not-reply@stackoverflow.email>

@tekvsakdan
Copy link

If it helps. This works fine:

DATE=1604431428000000
FROM=Garmin Forums <noreply@garmin.com>
cbthunderlink://MjAyMC0xMS0wM1QxOToyMzo0OC4wMDBaO0dhcm1pbiBGb3J1bXMgPG5vcmVwbHlAZ2FybWluLmNvbT4=

This does not work:

DATE=1604365263000000
FROM="Stack Overflow" <do-not-reply@stackoverflow.email>
cbthunderlink://MjAyMC0xMS0wM1QwMTowMTowMy4wMDBaOyJTdGFjayBPdmVyZmxvdyIgPGRvLW5vdC1yZXBseUBzdGFja292ZXJmbG93LmVtYWlsPg==

@tekvsakdan
Copy link

I installed a fresh copy of Thunderbird 78.4 in Windows, added a Gmail account, and cbthunderlink:// is not working on some messages. I didn't find any pattern except it is working fine on Exchange accounts and partially on the Gmail account. As I inspect your code (background.js) it should work but I don't know why it is not working. thunderlink:// links are working fine. I just gave up.

@tekvsakdan
Copy link

tekvsakdan commented Nov 6, 2020

I think I have found the problem. At least now I know why I have the problem. The problem is not the date, but the author (from). And not in all cases. The problem is the character "-" (hyphen). If the email contains "-" or the name of the sender has "hyphen" together, for example, "name-surname". It is connected somehow with Gmail (or similar services). If a user with "-" in their email address sends mail from Exchange to Gmail it is working fine. If the user with "-" sends from Gmail to Gmail or from Gmail to Exchange it is not working. Maybe Gmail "hyphen" is different than Exchange "hyphen". I really don't know. It's strange. At the moment I will try to change your code that will remove "-" from the author and I will see if this will help.

@tekvsakdan
Copy link

This solves my issue and now works perfectly:

cb_background.js line 243

let the_author = date_auth[1].replace(/-/g, ' ')

@CamielBouchier
Copy link
Owner

@tekvsakdan :

Hi, this is actually a great find! Thanks a lot. In some first tests I seem to be able reproducing it. I will do some further tests (especially on the impact on non-gmail accounts) and implement it.

Thanks again!

Camiel B.

CamielBouchier added a commit that referenced this issue Nov 14, 2020
Address issue #10
@CamielBouchier
Copy link
Owner

Should be fixed with release 0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants