Bug 8463 - (int-154256) libcalendar produces AALARM properties containing unescaped CRLF which prevents OSX synchronisation
(int-154256)
: libcalendar produces AALARM properties containing unescaped CRLF which preven...
Status: RESOLVED FIXED
Product: Calendar
General
: 5.0/(2.2009.51-1)
: All Maemo
: Unspecified normal with 13 votes (vote)
: 5.0/(10.2010.19-1)
Assigned To: unassigned
: calendar-general-bugs
:
: patch
:
:
  Show dependency tree
 
Reported: 2010-01-24 14:32 UTC by Dave Smith
Modified: 2010-03-15 20:51 UTC (History)
4 users (show)

See Also:


Attachments
Bluetooth activity log (4.95 KB, application/zip)
2010-01-24 14:37 UTC, Dave Smith
Details
Patch to VCalConverter.cpp (1.79 KB, patch)
2010-01-24 14:44 UTC, Dave Smith
Details


Note

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


Description Dave Smith (reporter) 2010-01-24 14:32:54 UTC
SOFTWARE VERSION: 
2.2009.51-1

EXACT STEPS LEADING TO PROBLEM: 
(Explain in detail what you do (e.g. tap on OK) and what you see (e.g. message
Connection Failed appears))
1. Enter an event on the N900 with an alarm
2. Using iSync on OSX, sync with the N900
3. Examine iCal for your event

EXPECTED OUTCOME:
The event appears with alarm details

ACTUAL OUTCOME:
The event does not appear at all

REPRODUCIBILITY:
always

EXTRA SOFTWARE INSTALLED:
iSync plugin from https://garage.maemo.org/projects/n900isyncplugin/ on the
Macintosh

OTHER COMMENTS:
Capturing the bluetooth packets emitted by the N900, the AALARM entry sent
looks like 


AALARM:20100129T130500
;PT3M
;

Logging the sync process on the Mac side produces error messages such as this 

TIME: 20:51:26.893
THREAD: 0x116af5bd0
TYPE: .sync.Parser.VCal
LEVEL: ERROR
LINE: 548
FUNCTION: -[VCalParser parseData:]
DEPTH: 11
LENGTH: 315

Failed to parse vCal (1) near index 97: BEGIN:VEVENT
SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:=
Fffffff
UID:490
DTSTART:20100118T211500Z
DTEND:20100118T221500Z
ATTACH:
SEQUENCE:0
LAST-MODIFIED:20100118T205403Z
DCREATED:20100118T205403Z
AALARM:20100118T210000
;PT3M
;
END:VEVENT
END:VCALENDAR

And the event is rejected.  If the AALARM line is changed to look like 

AALARM:20100129T130500;PT3M;

then it is parsed correctly and the event will appear in iCal with the correct
alarm details.

I have developed a simple patch for src/VCalConverter.cpp in
libcalendar-backend that fixes this problem and allows correct syncing with OSX
machines.

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.49 Safari/532.5
Comment 1 Dave Smith (reporter) 2010-01-24 14:37:44 UTC
Created an attachment (id=2114) [details]
Bluetooth activity log

Packet log captured by "PacketLogger" on OSX.  The packet at 19:32:18.762
exhibits the extra 0x0D/0x0A characters in the AALARM: line
Comment 2 Dave Smith (reporter) 2010-01-24 14:39:16 UTC
Details of the discussion of this issue can be found on talk.maemo.org at
http://talk.maemo.org/showthread.php?t=31345
Comment 3 Dave Smith (reporter) 2010-01-24 14:44:30 UTC
Created an attachment (id=2115) [details]
Patch to VCalConverter.cpp

This patch is mainly code lifted from ICalConverter.cpp.  It isn't pretty, but
I wanted to change as little as possible so I didn't refactor it to share the
function.
Comment 4 Lucas Maneos 2010-01-24 17:26:48 UTC
Thanks for the report, investigation, and patch!

The relevant part of the vcal (augmented as per RFC822) BNF:

aalarmparts    = 0*3(strnosemi ";") strnosemi
strnosemi    = *(*nonsemi ("\;" / "\" CRLF)) *nonsemi
nonsemi        = <any non-control ASCII except ";">

only allows escaped CRLFs.  Confirming.
Comment 5 Andre Klapper maemo.org 2010-01-25 13:14:27 UTC
Just for your information, currently Nokia does not officially support the
usage of the bluetooth connection. Work is progressing with USB from the sync
side.
Comment 6 Lucas Maneos 2010-01-25 13:18:51 UTC
(In reply to comment #5)
> Just for your information, currently Nokia does not officially support the
> usage of the bluetooth connection.

Sure, but the bug here is in the VCal conversion.  Whether the converted output
is then transmitted via bluetooth, saved to a file, etc isn't relevant.
Comment 7 Andre Klapper maemo.org 2010-02-09 20:06:31 UTC
This has been fixed in package
calendar-backend 0.6-16+0m5
which is part of the internal build version
10.2010.05-4
(Note: 2009/2010 is the year, and the number after is the week.)

A future public update released with the year/week later than this internal
build version will include the fix. (This is not always already the next public
update.)
Please verify that this new version fixes the bug by marking this bug report as
VERIFIED after the public update has been released and if you have some time.


To answer popular followup questions:
 * Nokia does not announce release dates of public updates in advance.
 * There is currently no access to these internal, non-public build versions.
   A Brainstorm proposal to change this exists at
http://maemo.org/community/brainstorm/view/undelayed_bugfix_releases_for_nokia_open_source_packages-002/
Comment 8 Andre Klapper maemo.org 2010-03-15 20:51:26 UTC
Setting explicit PR1.2 milestone (so it's clearer in which public release the
fix will be available to users).

Sorry for the bugmail noise (you can filter on this message).