Closed
Bug 248884
Opened 21 years ago
Closed 20 years ago
big calendar (ics more than 64k) is broken
Categories
(Calendar :: General, defect)
Calendar
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: artiip, Assigned: mostafah)
References
()
Details
Attachments
(3 files)
1.90 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
3.31 KB,
patch
|
mostafah
:
first-review+
|
Details | Diff | Splinter Review |
1.45 KB,
patch
|
mvl
:
first-review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040628
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040628
big calendar (ics more than 64k) is broken
file is truncated on update to magical 64kB size
Reproducible: Always
Steps to Reproduce:
1. instal big calendar
2. update
Actual Results:
file is broken
Expected Results:
not truncate the file and display all events
Comment 1•20 years ago
|
||
Confirmed.
The problem is in getting the file. When i used it as a local file, all was ok.
(but a bit slow...)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•20 years ago
|
||
The data is truncated at
http://lxr.mozilla.org/seamonkey/source/calendar/resources/content/calendarManager.js#689
689 result = String.fromCharCode.apply(this, result);
This is the conversion from an array of octets into a string.
Assignee | ||
Comment 3•20 years ago
|
||
Suggested workaround:
http://bugzilla.mozilla.org/show_bug.cgi?id=242939#c7
Comment 4•20 years ago
|
||
A better fix would be to use nsIDownloader. All we want is the file to be saved
to disk.
Hmm, now i think about it, we do check if it starts with something that at least
looks like an ical file. We could do that on the file too, but it means
downloading to a temp location etc.
http://lxr.mozilla.org/seamonkey/source/netwerk/base/public/nsIDownloader.idl
Comment 5•20 years ago
|
||
Re: comment 2: SpiderMonkey has a 64K limit on actual argument count in its
bytecode format, and Function.prototype.apply enforces that same limit.
We could have String.fromCharCodeArray but this is really a case where you want
to avoid going through a JS Array of character codes, then back to a JS string.
/be
Comment 6•20 years ago
|
||
Re c#4
Perhaps checking [x] data to see if it looks like an iCal file, if it does,
abort and re-pull using the Downloader to a file? or something similar?
Comment 7•20 years ago
|
||
*** Bug 265162 has been marked as a duplicate of this bug. ***
Patch implementing converting array to string 32k unicode characters at a time
(similar to comment #3).
(To generate a large calendar for testing, download (don't subscribe) several
different calendar files and import them into one, then upload it to a remote
site. Before this patch, subscribing to a large remote calendar would produce
a local file of only 65535 characters and would not succeed to point of showing
events. After this patch, it can become full size, and does show the events.)
Attachment #163935 -
Flags: first-review?(mostafah)
Comment 9•20 years ago
|
||
I've used the attached patch from comment #8 to successfully be able to download
and use my remote calendar file (sunone calendar) which was not working prior to
the patch.
This was on a Windows workstation, so the bug should be changed to reference all
OS's (rather than just Linux)
Assignee | ||
Updated•20 years ago
|
Attachment #163935 -
Flags: first-review?(mostafah) → first-review+
Assignee | ||
Comment 10•20 years ago
|
||
Fixed in CVS. Thanks.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 11•20 years ago
|
||
Comment on attachment 163935 [details] [diff] [review]
calendarManager.js patch getRemoteCalendarText to convert fromCharCode 32k at a time
A note and a question:
N:Still, a better way to fix this is to use nsIDownloader as stated in comment
#4.
Q:Could it be possible to have an incorrect result if the slice happens in the
middle of a UTF8 character which uses more than one byte?
Comment 12•20 years ago
|
||
(In reply to comment #11)
> Q:Could it be possible to have an incorrect result if the slice happens in the
> middle of a UTF8 character which uses more than one byte?
Err, this code has always assumed ISO-8859-1, not UTF-8.
Comment 13•20 years ago
|
||
An alternative approach would be to use the news methods introduced in bug
262385. That would require less code changes then nsIDownloader, but will only
work on new builds.
Comment 14•20 years ago
|
||
Patch to use nsIScriptableUnicodeConverter, wrapped inside try{}, to fallback
to the old method in case it fails.
It should be more robust against utf8 in the calendar file.
Updated•20 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•20 years ago
|
Attachment #166692 -
Flags: first-review?(mostafah)
Assignee | ||
Updated•20 years ago
|
Attachment #166692 -
Flags: first-review?(mostafah) → first-review+
Comment 15•20 years ago
|
||
patch checked in. Should really work now. closing bug (again...)
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Comment 16•20 years ago
|
||
Getting javascript warning
Warning: variable result hides argument
Source File: chrome://calendar/content/calendarManager.js
Line: 881, Column: 19
Source Code:
var result = unicodeConverter.convertFromByteArray( result,
result.length );
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 17•20 years ago
|
||
(patch -p 2 -i file.patch)
Remove 'var' from in front of assignment to result to fix warning.
Attachment #167596 -
Flags: first-review?(mvl)
Updated•20 years ago
|
Attachment #167596 -
Flags: first-review?(mvl) → first-review+
Comment 18•20 years ago
|
||
patch checked in
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Comment 19•19 years ago
|
||
The bugspam monkeys have been set free and are feeding on Calendar :: General. Be afraid for your sanity!
QA Contact: gurganbl → general
You need to log in
before you can comment on or make changes to this bug.
Description
•