Last Comment Bug 141606 - tags applied (IMAP) when offline not available after going online
: tags applied (IMAP) when offline not available after going online
Status: RESOLVED FIXED
: dataloss, verified1.8.1.18
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: P1 critical with 1 vote (vote)
: Thunderbird 3.0a3
Assigned To: David :Bienvenu
:
Mentors:
: 381324 (view as bug list)
Depends on:
Blocks: tb-tagsmeta
  Show dependency treegraph
 
Reported: 2002-05-01 15:44 PDT by laurel
Modified: 2008-11-04 16:12 PST (History)
11 users (show)
standard8: blocking‑thunderbird3.0b1+
mozilla: blocking‑thunderbird3+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
imap log w/labels on 2 mesgs (37.83 KB, text/plain)
2002-05-01 19:57 PDT, grylchan
no flags Details
log on 2nd computer w/no labels using same imap mail acnt (265.79 KB, text/plain)
2002-05-01 19:59 PDT, grylchan
no flags Details
proposed fix (1.83 KB, patch)
2008-08-26 11:58 PDT, David :Bienvenu
standard8: review+
neil: superreview+
dveditz: approval1.8.1.18+
Details | Diff | Review
patch for branch (3.12 KB, patch)
2008-10-20 09:36 PDT, David :Bienvenu
no flags Details | Diff | Review

Description laurel 2002-05-01 15:44:31 PDT
Using may01 branch builds

Labels which were applied to imap messages when offline will not be available on
the same account when opened on another machine. 

Steps:
1.  Open mail window, open an IMAP folder.
2.  Download some messages for offline use (I used Get Selected Messages) and go
offline. Note: I used messages which had no labels.
3.  Select one or more of the messages you downloaded, apply a label to the
selection.
4.  Go back online, see that the messages are still labeled. 
5.  Exit Netscape.
6.  On another machine, open a profile having that same IMAP account, go to that
folder and open it.  Check the messages you applied labels to when you were
offline on the other machine.  Notice the message labels aren't present.

Actual results:  message labels applied when offline were not available on
server, not available on same IMAP account on another machine.

Expected results:  message labels stored and available on other machine for same
IMAP account.
Comment 1 laurel 2002-05-01 15:48:14 PDT
Hmmm... should it store the label once I sync the folder? Am trying that...
Comment 2 David :Bienvenu 2002-05-01 16:28:55 PDT
attaching an imap protocol log from both machines (the one you set labels
offline and synchronize your offline changes with, and the one that you open the
folder in and expect to see the labels) would be helpful, thx!
Comment 3 grylchan 2002-05-01 19:57:51 PDT
Created attachment 81976 [details]
imap log w/labels on 2 mesgs

This log is with commercial branch 200204306 on NT 4.0
I downloaded 2 mesgs and gave them green 'personal' label.
2 mesgs had subject lines of 'wonder' and number '2'.
Comment 4 grylchan 2002-05-01 19:59:59 PDT
Created attachment 81977 [details]
log on 2nd computer w/no labels using same imap mail acnt

This log is using same imap mail acnt on commercial branch
2002050113 on linux 2.2. No labels present when I logged in.

I hope these 2 logs helped.
Comment 5 laurel 2002-05-02 17:25:18 PDT
And regarding comment #1 -- sync/download folder didn't help any.

So another scenario (which I assume would be the same root cause, please tell me
if it needs a separate bug) is:
1.  Select some IMAP messages, download for offline use.
2.  Go offline.
3.  Select one of the messages, label it.
4.  Move it to another folder on the same IMAP server.
5.  Go online.
Result:  the message isn't labeled.
Comment 6 Bill Sheppard 2002-07-17 11:20:23 PDT
My understanding is that labels are only stored locally (the IMAP server is not
used to store label information), which would make it difficult or impossible
for another system to be aware of the label.
Comment 7 Telmo Amaral 2004-11-09 19:52:36 PST
I was trying to find out whether this feature was already being considered, and
found this bug. Judging from the dates and the last comment, this seems to have
been put aside... Still, it would be a very useful feature. MS Outlook's message
flags (which are more or less equivalent to Mozilla's labels) can be set from a
machine, over IMAP, and then seen from a different machine. Looking at the
Internet headers of a message flagged for example as "For Your Information", I
see it contains the following line (just before the MIME-Version line):

X-Message-Flag: For Your Information

Couldn't this mechanism be used to store information about Mozilla's labels on
the IMAP server, as well? Or maybe this only works in Outlook because the IMAP
server I use is an MS Exchange one? Testing IMAP connectivity with telnet
<server> 143, I get:

* OK Microsoft Exchange IMAP4rev1 server version 5.5.2653.23 (mailhost) ready

T.
Comment 8 Telmo Amaral 2004-11-09 19:53:11 PST
I was trying to find out whether this feature was already being considered, and
found this bug. Judging from the dates and the last comment, this seems to have
been put aside... Still, it would be a very useful feature. MS Outlook's message
flags (which are more or less equivalent to Mozilla's labels) can be set from a
machine, over IMAP, and then seen from a different machine. Looking at the
Internet headers of a message flagged for example as "For Your Information", I
see it contains the following line (just before the MIME-Version line):

X-Message-Flag: For Your Information

Couldn't this mechanism be used to store information about Mozilla's labels on
the IMAP server, as well? Or maybe this only works in Outlook because the IMAP
server I use is an MS Exchange one? Testing IMAP connectivity with telnet
<server> 143, I get:

* OK Microsoft Exchange IMAP4rev1 server version 5.5.2653.23 (mailhost) ready

T.
Comment 9 David :Bienvenu 2004-11-09 20:06:31 PST
Telmo, we do store labels on the server, if the server supports it. This bug is
about setting labels while offline, and not having that played back when you go
back online...
Comment 10 Telmo Amaral 2004-11-10 02:55:08 PST
Thanks. I didn't realise that "going offline / back online" was the key aspect
of this bug. Also, sorry for the duplicate comment (don't know how to delete
it). Well, then my mail server doesn't store labels :-(  By the way, in this
case, it would be useful if, when you apply a label, Mozilla showed a message
box saying "Your IMAP server doesn't allow to store labels" (with a "Don't show
this dialog again" check-box). That way, people wouldn't think it's a bug worth
reporting.
T.
Comment 11 Magnus Melin 2008-06-22 07:59:08 PDT
Still a problem on linux/trunk. [moving component, updating summary]
Comment 12 Magnus Melin 2008-06-22 08:00:55 PDT
*** Bug 381324 has been marked as a duplicate of this bug. ***
Comment 13 Chris Withers 2008-06-22 08:59:32 PDT
(In reply to comment #6)
> My understanding is that labels are only stored locally (the IMAP server is not
> used to store label information), which would make it difficult or impossible
> for another system to be aware of the label.

It most certainly is for my IMAP server, and the labels are stored and accessible on multiple machines if done so online.

However, tags applied offline are not currently reliable.

Comment 14 ovidiu 2008-08-07 13:25:50 PDT
confirm for gmail imap, vista, Shredder version 3.0a2 (2008072418) and tb 2.0.0.16 same (different profiles/app ver -same imap acc)
When tagging online those stick between sessions/profiles, when tagging offline they do not stick, but for the original profile/app that tagged them. 
Comment 15 David :Bienvenu 2008-08-07 13:28:07 PDT
Is this for the default first five tags ($label1-5) or for tags after the first five, or both?

I'll look into this, but I did write code to do offline playback of tag changes.
Comment 16 ovidiu 2008-08-07 16:33:11 PDT
I just used default 1-5. (Thinkin that custom may go to other issues ..) 
+ 
1.I just tested another trick: 
-Got some tags (2,3) offline, got online. Close.
-Start other profile, no tags present on msg. Tag it (5) online.
-Start first profile again.. tadaa tag 2-3 lost, 5 is here
Idea is when tag in offline, they stick in the original app/profile as long as no other change from outside, but seams that when an online change is done, the offline tags go even in the original one.
2.If in same profile: 
-has tag 5 online(from another machine/profile or just from here)
-add tag 4 offline
-go online, 4 flush, only 5 is there. 

So, my conclusion would be that offline tags only work locally if no online ones present [in the same msg] from same machine or another.



Hope i don't miss a sett or a step somewhere.
[still switchin 2.0.0.16 vs 3.0a2pre to play ..]
Comment 17 David :Bienvenu 2008-08-07 16:36:05 PDT
Does this bug (offline tags not played back) happen with just a single client/machine?
Comment 18 ovidiu 2008-08-07 17:06:32 PDT
I tested on a single machine, vista, tb2 and 3, switching test profiles. Or even from same profile (last point 2. in comment 16) Repro always.

Again, hope not missing something ..
Comment 19 David :Bienvenu 2008-08-15 10:38:02 PDT
high priority
Comment 20 ovidiu 2008-08-22 08:05:42 PDT
fwiw, and may not worth, 
I tested with another imap server. [myx.net (vodafone, former xnet)] same tb version 3.0a2 (2008072418), 2 profiles, label 1-5 ..:

The symptom of this bug is here (even if server fault ..) 
-each profile show it's own "online" tags, none the offline applied 

What strikes me is that even not storing labels on server (comment #9 and obvious here) still flushes offline ones on going online, not online ones, so not all of them. In same profile, same session, just goin online. 
How is online status affecting this not stored on server?


  on imap the first source lines for a tagged msg
From - Fri Aug 22 17:17:57 2008
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Return-Path: ...

(and yes, the unread status is retained on server correctly ..no -Mozilla-Keys: there)
Comment 21 David :Bienvenu 2008-08-26 11:58:12 PDT
Created attachment 335569 [details] [diff] [review]
proposed fix

The old code was just wrong - we need to set the right op flags on the offline operations, and then playback works fine.
Comment 22 David :Bienvenu 2008-08-26 12:42:31 PDT
(In reply to comment #20)
> fwiw, and may not worth, 
> I tested with another imap server. [myx.net (vodafone, former xnet)] same tb
> version 3.0a2 (2008072418), 2 profiles, label 1-5 ..:
> 
> The symptom of this bug is here (even if server fault ..) 
> -each profile show it's own "online" tags, none the offline applied 
> 
> What strikes me is that even not storing labels on server (comment #9 and
> obvious here) still flushes offline ones on going online, not online ones, so
> not all of them. In same profile, same session, just goin online. 
> How is online status affecting this not stored on server?
> 
> 
>   on imap the first source lines for a tagged msg
> From - Fri Aug 22 17:17:57 2008
> X-Mozilla-Status: 0001
> X-Mozilla-Status2: 00000000
> Return-Path: ...
> 
> (and yes, the unread status is retained on server correctly ..no -Mozilla-Keys:
> there)
> 

we don't store tags in the message for IMAP, since IMAP has keywords and you can't edit an imap message anyway...
Comment 23 David :Bienvenu 2008-08-27 07:14:44 PDT
fixed, changeset 200:69676cb419aa
Comment 24 David :Bienvenu 2008-08-27 07:15:10 PDT
Comment on attachment 335569 [details] [diff] [review]
proposed fix

might be worth taking on the branch, after some trunk baking.
Comment 25 Daniel Veditz [:dveditz] 2008-09-22 11:30:09 PDT
Comment on attachment 335569 [details] [diff] [review]
proposed fix

Approved for 1.8.1.18, a=dveditz for release-drivers
Comment 26 David :Bienvenu 2008-10-20 09:36:42 PDT
Created attachment 343925 [details] [diff] [review]
patch for branch

this is what I'll land for 1.8.1 branch.
Comment 27 David :Bienvenu 2008-10-20 09:39:48 PDT
fixed on 1.8.1 branch
Comment 28 Al Billings [:abillings] 2008-11-04 16:12:23 PST
Verified fixed in 1.8.1.18 with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18pre) Gecko/2008110403 Thunderbird/2.0.0.18pre.

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