Closed
Bug 234935
Opened 21 years ago
Closed 14 years ago
Label is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system (tag)
Categories
(MailNews Core :: Database, defect)
MailNews Core
Database
Tracking
(Not tracked)
VERIFIED
FIXED
Thunderbird 3.3a1
People
(Reporter: ch.ey, Assigned: aceman)
References
(Blocks 1 open bug)
Details
(Keywords: dataloss, Whiteboard: [needs owner][has patch])
Attachments
(1 file, 1 obsolete file)
1.62 KB,
patch
|
Bienvenu
:
review+
|
Details | Diff | Splinter Review |
On my Linux installation I included accounts from my Windows system. The files
from Windows have CRLF as line ending, the ones native in Linux only LF.
Labeling (by filter or by hand) only works if the file uses LF line endings when
working on Linux.
I edited some mbox files and changed them to LF line endings: now the label
appears in X-Mozilla-Status2. If I change a files line endings from LF to CRLF,
the label I set doesn't show up in X-Mozilla-Status2.
I guess it's vice versa on Windows, there only files with CRLF line endings will
become affected when setting the label. But I didn't test this for now.
Reporter | ||
Comment 1•21 years ago
|
||
Yep, using Windows it's vice versa. Having a mbox file with LF line endings the
label will not get saved in the file, only in the .msf.
This is 1. annoying at least when using mailboxes accross different OS and 2.
strange since other changes like read/unread are written to the
X-Mozilla-Status, resp. X-Mozilla-Status2 in all cases.
OS: Linux → All
Hardware: PC → All
Comment 2•21 years ago
|
||
*** Bug 226952 has been marked as a duplicate of this bug. ***
Comment 3•21 years ago
|
||
I think this is because we figure out where the x-mozilla-status2 line is by
seeking relative to the x-mozilla-status line, and use the native line
terminator in the offset calculation.
So it seems easy to fix, just read the real line terminator...
Would something like this do it?
file nsMailDatabase.cpp:
Somewhere around line 410:
PRInt32 lineLen = PL_strlen(buf);
fileStream->write(buf, lineLen);
PRInt32 status2Pos = statusPos + lineLen;
// time to update x-mozilla-status2
// first find it
PRInt32 EOLskip;
// skip at most 2 chars of the linebreak
for (EOLskip=1; EOLskip<=2; EOLskip++) {
status2Pos++;
fileStream->seek(status2Pos);
fileStream->readline(buf,1);
if (PL_strlen(buf)) break; // we hit the first non-linebreak char
}
fileStream->seek(status2Pos);
I can make a real patch, if the idea is OK.
Updated•20 years ago
|
Product: MailNews → Core
Comment 6•19 years ago
|
||
aceman, can you make a patch for testing?
Updated•19 years ago
|
Summary: Label is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system → Labe is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system
Comment 7•19 years ago
|
||
woops, sorry for the bugspam, hit enter by accident.
Summary: Labe is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system → Label is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system
Comment 8•17 years ago
|
||
David, is this OS=All? Still valid?
Severity: normal → critical
QA Contact: esther → database
Comment 9•17 years ago
|
||
yes, looking at the code, it's still valid, and OS=ALL, and aceman's fix is roughly ok - I wouldn't use readline, though - I'd just use read and skip over 1 or 2 linebreak chars until I found an X.
![]() |
Assignee | |
Comment 10•17 years ago
|
||
Sorry, I am not familiar with mozilla code and functions, so I just used functions , where I could guess their meaning ;) I could look into it deeper, but it won't be soon. And I don't suffer from the problem in the description, I didn't migrate mi files to linux so far ;) I just threw in my fix proposal. Can anybody take it sooner?
Updated•17 years ago
|
Product: Core → MailNews Core
Updated•16 years ago
|
Blocks: tb-tagsmeta
Summary: Label is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system → Label is only stored in .msf file and not in mbox file if line ending of file isn't the one of the system (tag)
Comment 11•16 years ago
|
||
if someone can improve the patch please pick it up and run ... (even though bienvenu's assigned)
Flags: blocking-thunderbird3?
Whiteboard: has patch → [needs owner][has patch]
Comment 12•16 years ago
|
||
This seems to be a using Thunderbird on cross-platform issue which isn't really supported in Thunderbird's default configuration. Therefore not blocking TB 3 on this but we'd probably take the patch if someone would pick it up.
Flags: wanted-thunderbird3+
Flags: blocking-thunderbird3?
Flags: blocking-thunderbird3-
![]() |
Assignee | |
Comment 13•14 years ago
|
||
Attachment #480429 -
Flags: review?
Attachment #480429 -
Flags: review? → review?(bienvenu)
![]() |
Assignee | |
Comment 14•14 years ago
|
||
Reporter, can you check this patch fixes your problem? Is it still relevant in Thunderbird 3.1?
Reporter | ||
Comment 15•14 years ago
|
||
If no one else fixed it, It’s still relevant. But I can’t test the fix since I currently have no installation to build TB.
Updated•14 years ago
|
Assignee: bienvenu → acelists
Comment 16•14 years ago
|
||
I've taken your patch and tweaked it a little. I'll land it soon. Thx for the patch!
Attachment #480429 -
Attachment is obsolete: true
Attachment #480799 -
Flags: review+
Attachment #480429 -
Flags: review?(bienvenu)
Comment 17•14 years ago
|
||
I should point out that we don't store labels as flags anymore; we store them as keywords.
Comment 18•14 years ago
|
||
fix checked in.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Target Milestone: --- → Thunderbird 3.3a1
![]() |
Assignee | |
Comment 19•14 years ago
|
||
Thanks! I agree with your tweaks, I didn't know how to properly do error checking.
Reporter, as the fix was checked in, it seems you could now try precompiled Thunderbird 3.3a1 nightlies. Please confirm if the patch works.
Reporter | ||
Comment 20•14 years ago
|
||
I just noted that as David wrote, labels are stored differently now and I don't know how to trigger change of X-Mozilla-Status2 for an existing message.
At least everything works as it should when using files with "the other" file ending with the patch.
![]() |
Assignee | |
Comment 21•14 years ago
|
||
The problem with X-Mozilla-Status2 may be bug 383308, please join it if that is what you meant.
Verifying this bug according to your comment.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•