Closed Bug 1844452 Opened 1 year ago Closed 1 year ago

Tagging of (IMAP) message open in tab fails: An error occurred executing the cmd_toggleTag command: TypeError: event is undefined globalOverlay.js:102:13

Categories

(Thunderbird :: Mail Window Front End, defect)

Thunderbird 115
defect

Tracking

(thunderbird_esr115+ fixed, thunderbird117 wontfix)

RESOLVED FIXED
118 Branch
Tracking Status
thunderbird_esr115 + fixed
thunderbird117 --- wontfix

People

(Reporter: francesco, Assigned: darktrojan)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

Tagging of (IMAP) message open in tag fails:

Open message from IMAP folder in tab. Try to apply a tag.

Actual results:

Nothing in the UI, this in the error console:

 An error occurred executing the cmd_toggleTag command: TypeError: event is undefined globalOverlay.js:102:13
    goDoCommand chrome://messenger/content/globalOverlay.js:102
    InitMessageTags chrome://messenger/content/mailWindowOverlay.js:945

Expected results:

Tag should have been applied.

I can't work out why it works sometimes and other times it doesn't.

Summary: Tagging of (IMAP) message open in tag fails → Tagging of (IMAP) message open in tag fails: An error occurred executing the cmd_toggleTag command: TypeError: event is undefined globalOverlay.js:102:13
Summary: Tagging of (IMAP) message open in tag fails: An error occurred executing the cmd_toggleTag command: TypeError: event is undefined globalOverlay.js:102:13 → Tagging of (IMAP) message open in tab fails: An error occurred executing the cmd_toggleTag command: TypeError: event is undefined globalOverlay.js:102:13

I hereby confirm that bug and would like to add further details.

Environment: TB 115 64-bit, Windows, using IMAP only, Cyrus imapd 3.2.6 as IMAP server.

  • The profile that TB 115 uses is a literal copy of the profile that another installation of TB 102 uses (of course, TB 115 has upgraded that profile, but we didn't change anything besides that).
  • In TB 102, using the same (in the sense describe above) profile, tagging works as expected with no issue.
  • The OP states that tagging sometimes works and sometimes does not work for him. In our case, it fails without exception with a bunch of messages from various folders and accounts. TB 115 consequently ignores every attempt to add a tag in a message tab.

For clarification:

  • Tagging works as excepted if we apply tags in the message list (e.g., by selecting a message, right-clicking on it and applying the tag using the context menu).
  • Tagging works as expected if we apply tags in the preview window.
  • Tagging fails if we apply tags in a message tab. That is, if we double-click a message in the message list, a new tab opens, showing that message. When we attempt to apply a tag in that tab, nothing happens. Notably, no label is shown in the message header area (as it was in TB 102), there is no other change anywhere in the UI, and the tag actually is not applied.

It works for me with a cyrus imap server and another generic imap server (intermail used by my isp). There must be another variable in reporter's and Binarus' setup that is causing it. Maybe windows specific (I'm on linux).
Can't say that I've ever tried to set a tag on a message open in a tab. There appears to be three ways: set tags via the "more" button or right click and set the tag, or set via Messages menu item. They all work for me.
I haven't changed anything in imap tagging for, it seems, several years (FWIW).

I can't work out why it works sometimes and other times it doesn't.

Only fails sometimes, not predictable. You need to have a really complicated profile, many accounts and folders. This is not an IMAP issue, it's a UI issue where the front-end code sometimes fails, see error log.

Can't say that I've ever tried to set a tag on a message open in a tab. There appears to be three ways: set tags via the "more" button or right click and set the tag, or set via Messages menu item. They all work for me.
I haven't changed anything in imap tagging for, it seems, several years (FWIW).

Gene, thank you very much again! Like Francesco, I believe that this is not an IMAP issue. I have conducted some more research now and can add the following:

In addition to the three ways you already mentioned, there is a fourth way: In the new tab, below the menu bar, there is an additional button "Tag". This is the only method that I was using in my first tests. In my installation, I now have a situation that is somehow weird:

"More" button:

  • Setting tags works.
  • Removing tags works.

Right-click:

  • Setting tags works.
  • Removing tags works.

"Tag" button:

  • Setting tags does not work.
  • Removing tags works via "Remove All Tags" in the dropdown menu.
  • Removing tags does not work by clicking on the currently set tag in the dropdown menu.

"Message -> Tag" menu entry:

That's the moment where it gets really weird. It seems that it behaves like so:

  • As long as we haven't tried to set or remove a tag via the "Tag" button before, "Message -> Tag" works as expected and can be used to set and remove tags.
  • However, if we use the "Tag" button to set a tag, this action not only fails, but "blocks" the menu entry "Message -> Tag"; by that I mean that the menu entry is still visible and not greyed out, but can't be used to set or remove tags any more. That menu entry can then be "unblocked" by setting or removing a tag either via the "More" button or via right-click. After having been unblocked that way, it works again as expected.

So I have managed to use the only UI element that does not work correctly during my first tests, and I didn't even try the three other ones. I really apologize for that. My only excuse is that I probably was distracted at this time by issues that were much more important :-)

In summary, to reproduce the problem (please execute the steps exactly in the order shown below):

  • IMAP environment (but maybe it happens with local folders, too; I really don't know).
  • Open a message by double-clicking it so that it appears in a new window / tab.
  • Set and remove a tag using the context menu that appears after a right-click anywhere in the message. Note that this works.
  • Set and remove a tag using the "More" button. Note that this works.
  • Set and remove a tag using the "Message" menu. Note that this works.
  • Try to set a tag using the "Tag" button. Note that this fails.
  • Try to set a tag using the "Message" menu. Note that this now fails (although it has worked before).
  • Set and remove a tag using the "More" button. Note that this works.
  • Set and remove a tag using the "Message" menu. Note that this works again (although it has failed before).

Can anybody confirm that the "Tag" button can't be used to set a tag in a message tab (not preview)? And that the attempt to do so makes "Message -> Tag" fail, too? And that the other two options ("More" button and context menu) always work as expected with respect to tagging?

P.S.
Given the findings above, the issue partially shows dependent on the steps that have been carried out before. This may lead to the impression that it sometimes works and sometimes not, as the OP has stated.

@OP: Could you please shortly describe exactly which methods you have tried?

@TB team:

Could somebody of the developers please try that? I have described in detail how to reproduce the bug. However, the status is still "unconfirmed". It's really a no-brainer to follow the steps above. If you can reproduce the issue, the status should be changed to something else than "unconfirmed". If you can't reproduce the issue, that report should be closed with "worksforme".

Thank you very much, and best regards,

Binarus

From comment 4:

Open a message by double-clicking it so that it appears in a new window / tab.

For me double-clicking opens a new tab, not a window. (Edit: N/A -- it's a config option.) Also, when I have the message open in the new tab I don't see a "tag" button. There is only a "more" button and inside it there is a "tag" selection and setting a tag there works OK for me.

However, if I right click the message and open it in a new window, I then see the "tag" button to the right of "Get messages" and "Write" buttons. But setting the tag there also works for me.

I haven't tried booting into windows to see if maybe this is OS dependent.
:
:
Ok, I tried one more thing on linux. I added a custom "Tag" toolbar button item which shows up along the top row of the display by itself. It works OK when message in preview pane but doesn't work when in a tab. I also see a message in error log like is reported in comment 0:

13:38:46.216
An error occurred executing the cmd_toggleTag command: TypeError: can't 
access property "target", event is undefined
globalOverlay.js:102:13

I don't see any mention of "custom" or "toolbar" in above comments so I'll assume the reporters have added the custom button or windows includes it by default and linux doesn't.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Maybe fixed by bug 1846336. Bug 1846336 comment #11 states:
The this._toggleMessageTag had got the wrong this (got exception and failed, causing the confusing message.)

No, on today's Daily, trying to add a tag via the "Tag" button (via customise) still fails with the initially reported error.

Maybe Geoff knows what the problem is. Adding him to CC and NI since I don't know if he is aware of this bug. This is a bit outside my area.
Just to restate the bug: You can't set a tag on a message in a tab using a tag button added to the toolbar as a customization. All other ways to set a tag work OK.

Flags: needinfo?(geoff)

Yeah, I can see what's up with that. Somehow I made the 3-pane tab not have this problem but missed fixing the message tab at the same time.

Flags: needinfo?(geoff)

This is the same code as for mail3PaneTab, except it never got applied to mailMessageTab.

Assignee: nobody → geoff
Status: NEW → ASSIGNED
Target Milestone: --- → 118 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/cc8581a68279
Fix running commands with arguments in mailMessageTab. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Comment on attachment 9349083 [details]
Bug 1844452 - Fix running commands with arguments in mailMessageTab. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): new mail tabs
User impact if declined: some commands fail in some circumstances (like tagging messages from the main menu)
Testing completed (on c-c, etc.): in 118 beta 1
Risk to taking this patch (and alternatives if risky): no

Attachment #9349083 - Flags: approval-comm-esr115?

Comment on attachment 9349083 [details]
Bug 1844452 - Fix running commands with arguments in mailMessageTab. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr115

Attachment #9349083 - Flags: approval-comm-esr115? → approval-comm-esr115+

Comment on attachment 9349083 [details]
Bug 1844452 - Fix running commands with arguments in mailMessageTab. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr115

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: