First Last Prev Next    No search results available
Details
: When switching identities, old signatures are not removed
Bug#: 25104
: smarttemplate4
: General
Status: RESOLVED
Resolution: WORKSFORME
: PC
: Windows 7
: unspecified
: P2
: normal
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Jiri Svacina <jirka.svacina@gmail.com>
Assigned To: Axel Grude <axel.grude@gmail.com>
:

Attachments
0.9.2 prerelease 23 (246.72 KB, application/x-xpinstall)
2012-08-23 02:44, Axel Grude
no flags Details
2.9.1 pre 40 (247.53 KB, application/x-xpinstall)
2012-08-24 15:22, Axel Grude
no flags Details
SmartTemplate 0.9.1 settings (145.56 KB, application/pdf)
2012-08-27 06:04, Jiri Svacina
no flags Details
0.9.2 pre 44 (247.65 KB, application/x-xpinstall)
2012-08-27 08:00, Axel Grude
no flags Details
Composing email and switching id (3.12 KB, text/plain)
2012-08-28 23:02, Jiri Svacina
no flags Details
Replying and switching id (6.24 KB, text/plain)
2012-08-28 23:03, Jiri Svacina
no flags Details
Forwarding and switching id (9.33 KB, text/plain)
2012-08-28 23:03, Jiri Svacina
no flags Details
new mail log, how it should look (1.50 KB, text/plain)
2012-08-29 00:55, Axel Grude
no flags Details
0.9.2 pre48 (246.31 KB, application/x-xpinstall)
2012-08-29 04:28, Axel Grude
no flags Details
Log 0.9.2pre48_compose_switch_id_1-3-1_without_%sig% (2.52 KB, text/plain)
2012-08-29 05:03, Jiri Svacina
no flags Details
Log 0.9.2pre48_compose_switch_id_1-3-1_with_%sig% (2.51 KB, text/plain)
2012-08-29 05:06, Jiri Svacina
no flags Details
0.9.2 pre 51 (246.41 KB, application/x-xpinstall)
2012-08-30 01:24, Axel Grude
no flags Details


Note

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

Related actions


Description:   Opened: 2012-08-22 23:41
Hello,

I'm using SmartTemplate4 v0.9.1 in TB 14.0. I have following problem:
I have set up 4 email accounts. For 2 of them I'm using various signatures
(they are set up in TB account settings and I'm also using %sig% in
SmartTemplate setting for "Write" and "Reply"). 2 remaining accounts don't use
signatures.
Simply it is like this:
Account 1 – Signature 1 (default email account)
Account 2 – Signature 2
Account 3 – no Signature
Account 4 – no Signature

When I compose new message in TB, everything is OK – I see predefined
Signature 1 for my default account in message window.
I.e. I see
Signature 1

But when I change my default email account to Account 2, I see twice Signature
2.
In mail window there is
Signature 2
Signature 2

When I change account back to Account 1, I see following
Signature 2
Signature 2
Signature 1

When I change account e.g. to Account 3 (no signature is defined for this
account), I see following
Signature 2
Signature 1

When I change account e.g. back to Account 1, I see following
Signature 2
Signature 1
Signature 2
Signature 1
Signature 1

Note: "Change account" means that I have still opened compose message window
and I'm changing account in field "From".

Is there any way how to resolve this problem? 
Thank you for your hard work on this extension.
------- Comment #1 From Axel Grude 2012-08-23 02:44:13 -------
Created an attachment (id=7348) [details]
0.9.2 prerelease 23

This version should behave a lot better. We had some fundamental problems
parsing the email, so it took a lot of rewriting.

Please bear in mind that switching identities in composer will only replace the
old header templates and quote header if you didn't do any manual modifications
yet. But this version should remove the old signature, template and quote
header when you switch accounts (and haven't typed / deleted anything) on a
brand new email.

Note that we have decided to split the template (where you put salutation and
other elements of your email template) and the quote header (the part that
introduces the original email, such as "on 12/04/2012, Axel wrote:", into 2
separate text fields in order to better support "reply at bottom". I haven't
fully tested identity switching in plain text mode, yet; but it seems to work
well in HTML mode.
------- Comment #2 From Jiri Svacina 2012-08-23 04:00:15 -------
Thank you for your quick answer. I tried the version you provided but it still
not works for me. Still the same problem with signatures when switching
identity...
------- Comment #3 From Axel Grude 2012-08-23 05:52:23 -------
(In reply to comment #2)
> Thank you for your quick answer. I tried the version you provided but it still
> not works for me. Still the same problem with signatures when switching
> identity...
> 

Are you using plain text or html?
is your signature plain text or html?
is the signature given as text or as attached file?
------- Comment #4 From Axel Grude 2012-08-23 05:54:49 -------
(In reply to comment #2)
> Thank you for your quick answer. I tried the version you provided but it still
> not works for me. Still the same problem with signatures when switching
> identity...
> 

also which position setting for sig did you configure.

[ ] reply above + sig below quote
[ ] reply above + sig below reply + above quote
[ ] reply below
------- Comment #5 From Jiri Svacina 2012-08-23 06:07:37 -------
I'm using HTML. Signature is also HTML. The signature is given as text but I
tried to insert signature from file as well - no difference.
Position setting in TB I use reply above + sig below reply + above quote.
------- Comment #6 From Axel Grude 2012-08-24 15:22:13 -------
Created an attachment (id=7354) [details]
2.9.1 pre 40

0.9.2, prerelease 40

This one behaves much better again, by removing templates it has added more
reliably, but also when you change identities (before editing in composer) it
will not run the original Thunderbird code (LoadIdentity function) anymore,
because that also messed with the position of the signature. This is not yet
tested without signatures and in plain text, but I was able to switch between
several different profiles which had various settings for reply position (above
quote with sig below quote, above quote with sig below reply, below quote) and
managed to remove the previous message template and signature and citation
header, without residues, each time.
------- Comment #7 From Jiri Svacina 2012-08-27 05:27:25 -------
Thank you, but still no luck with this version. When I change identity no.1 to
identity no.2, it works - signature no.2 is shown and signature no.1 is
deleted. But when I change it back to identity no.1, in the message still stays
signature no.2.
But I resolved it by this way - I'm using SmartTemplate for headers (reply,
forward) and signature is set by TB (I'm not using %sig% in SmartTemplate). It
looks that it works fine. But it works only with ST4 version 0.9.1.
------- Comment #8 From Axel Grude 2012-08-27 05:40:57 -------
(In reply to comment #7)
> Thank you, but still no luck with this version. When I change identity no.1 to
> identity no.2, it works - signature no.2 is shown and signature no.1 is
> deleted. But when I change it back to identity no.1, in the message still stays
> signature no.2.

Can you attach both templates & headers?

> But I resolved it by this way - I'm using SmartTemplate for headers (reply,
> forward) and signature is set by TB (I'm not using %sig% in SmartTemplate). 

Yes, that is the cases I tested it for, as well. I haven't tested against the
%sig% variable at all.

> It looks that it works fine. But it works only with ST4 version 0.9.1.

If you say 0.9.2 prerelease 40 does not work removing sig from id2 to id1 I
would like to see what exactly these templates are, so i can reproduce the
issue. There were a numerous fundamental changes to the way the message is put
together in pre40, and these are _not_ likely pr planned to be changed back -
they will be in 0.9.2 final release, so it is important to me that they work in
your test case. You can send me the templates directly if you do not want them
on the bug.
------- Comment #9 From Jiri Svacina 2012-08-27 06:04:56 -------
Created an attachment (id=7358) [details]
SmartTemplate 0.9.1 settings
------- Comment #10 From Jiri Svacina 2012-08-27 06:05:45 -------
So as mentioned, I'm currently using ST4 0.9.1. My current ST setting is
attached (not sure if it will help you).
I tried again version 0.9.2 and there is problem that there is still the same
signature no.1. It doesn't matter if I switch id to no.2 or 3. Sig stays always
from id no.1. In 0.9.1 there is not this problem.
------- Comment #11 From Axel Grude 2012-08-27 07:58:07 -------
Can you check your error console. Make sure "content" logging and warnings are
enabled.
------- Comment #12 From Axel Grude 2012-08-27 08:00:26 -------
Created an attachment (id=7359) [details]
0.9.2 pre 44

This version makes a better job of deleting deep level elements (previous
versions would only delete them if they were direct children of the root
element <body>). I was able to reproduce the problem when forwarding and fix it
with this version.
------- Comment #13 From Jiri Svacina 2012-08-27 23:58:56 -------
There is something strange. I installed your latest version. I tried to compose
new email and change identity. Signatures were changed according to selected
identity – it worked. Then I tried reply for email and again tried switch
identity. It didn't work. There was still sig from id.1. Then I tried again
composing new email and change identity. But it already didn't work. There
always stays sig from id 1. I tried uninstall and reinstall last ST but it
already doesn't work – when switching id there is still the same sig. I don't
know if there is some problem in my TB.

Re error console. Please could you let me know whether it is possible somehow
export it to TXT file? There is quite a lot of errors. I also noticed that
there are some errors already during installation of this extension. And second
thing – my TB is in Czech language and error console too. I didn't find a way
how to change it to English for you.
------- Comment #14 From Axel Grude 2012-08-28 04:05:38 -------
(In reply to comment #13)
> 
> Re error console. Please could you let me know whether it is possible somehow
> export it to TXT file? There is quite a lot of errors. I also noticed that
> there are some errors already during installation of this extension. And second
> thing – my TB is in Czech language and error console too. I didn't find a way
> how to change it to English for you.

Doesn't matter... I can read them in Czech as well.

Install console2 extension.

Once it is installed, open console and click on All button (top left)
enable Options (right hand of error log window)
  Report Strict Warnings (3rd item in options menu)
  Report all JS exceptions (5th item)

For testing, make sure you clear the output (there are always "Noise" messages
there) before you test.

When you have done a test step select all text in error console (right-click or
CTRL+A)
Copy the text to the clipboard (CTRL+C)

no need for screen shots!!!!!!!
------- Comment #15 From Axel Grude 2012-08-28 04:07:54 -------
(In reply to comment #14)

> 
> When you have done a test step select all text in error console (right-click or
> CTRL+A)

Whenever you do a new test, make sure you clear the old error output, so there
are less messages for me to read.

I am especially interested in errors (red icon) and warnings (yellow icon). CSS
errors are unimportant for this error.
------- Comment #16 From Jiri Svacina 2012-08-28 05:02:48 -------
During my testing there were following errors shown in error console in version
0.9.2pre44.

Varování: ReferenceError: reference to undefined property img.className
Zdrojový soubor: chrome://messenger/content/mailWindowOverlay.js
Řádka: 2948
 ----------
Varování: ReferenceError: reference to undefined property
Components.classes['@mozilla.org/privatebrowsing;1']
Zdrojový soubor: chrome://global/content/globalOverlay.js
Řádka: 17
------- Comment #17 From MarkyMarkDE 2012-08-28 05:16:20 -------
(In reply to comment #16)
this errors are NOT from SmartTemplate4 add-on!
------- Comment #18 From Axel Grude 2012-08-28 05:36:24 -------
(In reply to comment #16)
> During my testing there were following errors shown in error console in version
> 0.9.2pre44.
> 
> Varování: ReferenceError: reference to undefined property img.className
> Zdrojový soubor: chrome://messenger/content/mailWindowOverlay.js
> Řádka: 2948
>  ----------
> Varování: ReferenceError: reference to undefined property
> Components.classes['@mozilla.org/privatebrowsing;1']
> Zdrojový soubor: chrome://global/content/globalOverlay.js
> Řádka: 17
> 

Ok, although these were not from SMartTemplate4, you can add some context to
these by enabling the [x]Debug option in the st4 options window; this way st4
will tell you "what it does" during identity switching - you can add even more
detail to the output if you right-click the debug checkbox and enable the
following settings:

debug.deleteNodes
debug.events
debug.functions
debug.functions.delReplyHeader
debug.functions.insertTemplate
debug.identities

It should only show messages (no warnings or errors). But it might still help
to see _when_ the two errors you mentioned happen. Since I expect the output to
be lengthy, can you paste it into a text file and attach that to the bug
please?
------- Comment #19 From Axel Grude 2012-08-28 05:38:27 -------
(In reply to comment #16)
> During my testing there were following errors shown in error console in version
> 0.9.2pre44.
> 
> Varování: ReferenceError: reference to undefined property img.className
> Zdrojový soubor: chrome://messenger/content/mailWindowOverlay.js
> Řádka: 2948
>  ----------
> Varování: ReferenceError: reference to undefined property
> Components.classes['@mozilla.org/privatebrowsing;1']
> Zdrojový soubor: chrome://global/content/globalOverlay.js
> Řádka: 17
> 

Also, can you try a test without using %sig% ? with the new more flexible
separate interface (Template + Quote Header) and the Thunderbird Account
Settings you should be able to achieve pretty much any positioning even without
using %sig%.
------- Comment #20 From MarkyMarkDE 2012-08-28 05:41:25 -------
(In reply to comment #16)
Example: this is an error log of smarttemplate4

Error: headerParam is not defined
File: chrome://smarttemplate4/content/messengercomposeOverlay.js
Line: 181
------- Comment #21 From Axel Grude 2012-08-28 05:49:09 -------
(In reply to comment #20)
> (In reply to comment #16)
> Example: this is an error log of smarttemplate4
> 
> Error: headerParam is not defined
> File: chrome://smarttemplate4/content/messengercomposeOverlay.js
> Line: 181
> 

I almost answered that one :)

Note: Mark meant

"this is what an error log of st4 would look like"

in the example an error gets thrown in the source code of one of the files by
st4 - which can be seen by looking at its chrome address:

chrome://smarttemplate4/
------- Comment #22 From MarkyMarkDE 2012-08-28 05:59:13 -------
(In reply to comment #21)
> (In reply to comment #20)
> > (In reply to comment #16)
exactly this i mean Axel :)
my reply to comment #16 was the first one but i have to search an old log for
the example here and this i would like clear with comment #20 as reply to
#16...
Sorry for confusing :)
You know sometimes i'm too fast :)
------- Comment #23 From Jiri Svacina 2012-08-28 06:32:57 -------
Hello guys, I understand what you need from me but I have to leave my PC now.
Will go back to you later today or at latest tomorrow. BTW I'm not using %sig%
in my templates. It is mentioned earlier. I'm using ST only for headers in RE
and FW messages. Signatures are placed automatically by TB.
------- Comment #24 From Jiri Svacina 2012-08-28 23:02:15 -------
Created an attachment (id=7364) [details]
Composing email and switching id

I did following:
1. Run TB, clear error console and start composing message and switching id ->
save console log (see compose.txt)
2. Clear error console and start replying message and switching id -> save
console log (see reply.txt)
3. Clear error console and start forwarding message and switching id -> save
console log (see forward.txt)

I also changed name and email of my identities which I have set up in TB. I
replaced them by "user1" etc. I made this change in TB so there is no editing
in logs.
------- Comment #25 From Jiri Svacina 2012-08-28 23:03:01 -------
Created an attachment (id=7365) [details]
Replying and switching id
------- Comment #26 From Jiri Svacina 2012-08-28 23:03:32 -------
Created an attachment (id=7366) [details]
Forwarding and switching id
------- Comment #27 From Axel Grude 2012-08-29 00:55:50 -------
Created an attachment (id=7367) [details]
new mail log, how it should look

I have looked at the first log, and it is interesting to see that some messages
appear to be missing altogether. From what I can see you have 4 identities, and
you were opening a new mail with id1, then switched to 2, 3, and 4.

One thing I am missing is the call to 
SmartTemplate4.extractSignature()
after SmartTemplate4.clearTemplate()

I hope you had warning and errors switched on during the logging as well. The
only reason (apart from an error) that this might not have been called is that
the setting:

extensions.smartTemplate4.id1.def

is set to "false". If this is the case, set them to true and test again.

can you check in your configuration settings, by filtering for:
extensions.smartTemplate4.id*.def

and check whether it is set to true for the 4 test accounts?
------- Comment #28 From Jiri Svacina 2012-08-29 02:24:21 -------
Axel, you will probably want to kill me...

extensions.smartTemplate4.id*.def for all 4 identities is set to "TRUE".

BUT:
As I mentioned, I don't use %sig% in my template. It causes me problem which I
will report you soon. But when I again add %sig% into my template, signatures
where almost correctly switched according to selected id. Procedure
SmartTemplate4.extractSignature() was already in log.

I'm mentioning "almost correctly switched" because of following:
1. I start composing new msg with default id1, default sig1 is there.
2. I switch id to 2, sig2 is there (sig1 is deleted).
3. I switch id to 3, sig3 is there (sig2 is deleted) etc.

But when I want to change id back to default id1, in the msg still remains sig
from last tested id (in this example it is sig3). It is not possible to get
into msg again default signature. All other (non default) signatures are
changed correctly according to selected id. I tried also change default
identity but still the same result. After I change id from default to another,
default id (signature) is not possible to get back.

I hope you understand what I mean. Please let me know whether you want me to
send you new log.
------- Comment #29 From Axel Grude 2012-08-29 04:24:53 -------
(In reply to comment #28)
> Axel, you will probably want to kill me...
> 
> extensions.smartTemplate4.id*.def for all 4 identities is set to "TRUE".
> 
> BUT:
> As I mentioned, I don't use %sig% in my template. It causes me problem which I
> will report you soon. But when I again add %sig% into my template, signatures
> where almost correctly switched according to selected id. Procedure
> SmartTemplate4.extractSignature() was already in log.

SmartTemplate4.extractSignature() should be called always (no matter whether
%sig% is used)

currently I was only looking at the first file (compose.txt) and there is no
extractSignature mentioned. I will upload a new version which will mention this
in the log. Also in the log you switch from 1->2->3->4

but the error occurs when you switch back from X->1, correct? So this is the
only case we are interested in.

For a new test-case, just switch 1->3->1. Wait at least 5 seconds before you
switch back, that will make it easier for me to find the start of the switch. I
will attach a new test version shortly.
------- Comment #30 From Axel Grude 2012-08-29 04:28:15 -------
Created an attachment (id=7368) [details]
0.9.2 pre48

Ok, can you test again, make sure all debug settings are active as detailed
above. It is ok just to work with the compose-new case for the moment; do not
use %sig%.

Is there something special about the default identity? Is it using the "Common"
template or has is got its own?
------- Comment #31 From Jiri Svacina 2012-08-29 05:03:50 -------
Created an attachment (id=7369) [details]
Log 0.9.2pre48_compose_switch_id_1-3-1_without_%sig%

Still the same, when I don't use %sig%, there is always the same sig from
default id in the email.

My identities have the same setting in TB. All use "common" settings in ST.
------- Comment #32 From Jiri Svacina 2012-08-29 05:06:55 -------
Created an attachment (id=7370) [details]
Log 0.9.2pre48_compose_switch_id_1-3-1_with_%sig%

When I use %sig%, sig is changed correctly but it is not possible to go back to
default id. In case of identity changing in order 1-3-1, there stays signature
from id 3. Log is also attached.
------- Comment #33 From Axel Grude 2012-08-30 01:24:17 -------
Created an attachment (id=7376) [details]
0.9.2 pre 51

A newer version, this time including fixes for top-reply (and sig below repl,
but above quote). Previous versions would put the sig to the very top of the
Email. Also, I included a fix for displaying the correct mail identity when
opening st4 settings from the statusbar icon.
------- Comment #34 From Axel Grude 2012-08-30 01:26:44 -------
(In reply to comment #31)
> Created an attachment (id=7369) [details] [details]
> Log 0.9.2pre48_compose_switch_id_1-3-1_without_%sig%
> 
> Still the same, when I don't use %sig%, there is always the same sig from
> default id in the email.
> 
> My identities have the same setting in TB. All use "common" settings in ST.
> 

Pretty sure the answer is because you use Common settings. This is probably one
of the worst tested areas in st4 as we do not use this setting normally (I have
a separate st4 template for each identity). You could try this yourself to see
whether it is a valid workaround for the problem.
------- Comment #35 From Jiri Svacina 2012-08-30 01:50:46 -------
No change with this version. There is still the same problem.
Of course I tried use also non common settings in ST, but result was the same.
------- Comment #36 From Axel Grude 2012-08-30 02:52:03 -------
Would(In reply to comment #35)
> No change with this version. There is still the same problem.
> Of course I tried use also non common settings in ST, but result was the same.
> 

Fair enough. Would you be available for a screen sharing session via join.me?
If I can reproduce it on your machine using the Javascript debugger I will be
able to find out what it happening. You can contact me via EMail if you are
interested.
------- Comment #37 From Jiri Svacina 2012-08-30 03:58:15 -------
I'm sorry, I don't want to share my screen...

But I still would like to tell you this.
I asked my colleague to make the same test of ST. He did following:
1. Install clean WinXP SP3 into VirtualBox.
2. Install clean TB15.
3. Install last ST which you provided. No other extensions were installed.
4. Set up 4 testing email account.

Result?
Exactly the same as in my case.

If he didn't use %sig% in ST, when you create new message there is always
signature from default id. It doesn't matter which id you switch.

If he used %sig%, after changing id it was not possible to get back sig from
default id.
------- Comment #38 From Axel Grude 2012-11-30 04:00:58 -------
(In reply to comment #37)
> I'm sorry, I don't want to share my screen...
> 
> But I still would like to tell you this.
> I asked my colleague to make the same test of ST. He did following:
> 1. Install clean WinXP SP3 into VirtualBox.
> 2. Install clean TB15.
> 3. Install last ST which you provided. No other extensions were installed.
> 4. Set up 4 testing email account.
> 
> Result?
> Exactly the same as in my case.
> 
> If he didn't use %sig% in ST, when you create new message there is always
> signature from default id. It doesn't matter which id you switch.
> 
> If he used %sig%, after changing id it was not possible to get back sig from
> default id.
> 
Did this get resolved with the 0.9.2 official release? I would like to close
this bug...
------- Comment #39 From Axel Grude 2013-07-10 09:56:54 -------
FOr the moment I will mark this as WORKSFORME. Switching Identities is not
perfect by any means, but should do the job if you only do once or twice and
not dozens of times. Also, once you edit the email, Thunderbird itself takes
over, and it will have _big_ problems replacing the signature then.

First Last Prev Next    No search results available