Closed
Bug 322827
Opened 20 years ago
Closed 20 years ago
All X-Components are serialized with BEGIN:X, rather than BEGIN:X-FOO
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
RESOLVED
FIXED
Lightning 0.3
People
(Reporter: jminta, Assigned: mvl)
References
()
Details
(Keywords: dataloss, Whiteboard: [libical-upstream?])
Attachments
(3 files, 1 obsolete file)
|
1.16 KB,
text/plain
|
Details | |
|
853 bytes,
patch
|
mattwillis
:
first-review+
dmosedale
:
second-review+
|
Details | Diff | Splinter Review |
|
3.94 KB,
patch
|
mvl
:
first-review+
mvl
:
second-review+
|
Details | Diff | Splinter Review |
Something like
BEGIN:X-SOMETHING-COOL
X-AWESOME-THING1:yay
END:X-LOCATION
is disappearing when publishing/editing the calendar.
| Reporter | ||
Comment 1•20 years ago
|
||
err, that should be
END:X-SOMETHING-COOL
Updated•20 years ago
|
Blocks: lightning-0.1
Updated•20 years ago
|
No longer blocks: lightning-0.1
Target Milestone: --- → Lightning 0.2
| Reporter | ||
Updated•20 years ago
|
Flags: blocking0.3+
Comment 2•20 years ago
|
||
The bugspam monkeys have struck again. They are currently chewing on default assignees for Calendar. Be afraid for your sanity!
Assignee: base → nobody
| Reporter | ||
Updated•20 years ago
|
Whiteboard: [swag:2d]
| Reporter | ||
Comment 3•20 years ago
|
||
This is a xpcshell test for this bug. It shows that even though the X-Component is added, it fails to be serialized.
| Reporter | ||
Comment 4•20 years ago
|
||
Looks like we have some weird component-conversion going on here. If I try simply
var xComp = icsServ.parseICS("BEGIN:X-SOMETHING-COOL\nX-AWESOME-THING1:yay\nEND:X-SOMETHING-COOL");
dump(xComp.serializeToICS()+'\n');
it will throw with BADARG, due to http://lxr.mozilla.org/mozilla/source/calendar/libical/src/libical/icalcomponent.c#299
The fact that this is saying its ICAL_NO_COMPONENT, rather than ICAL_X_COMPONENT is likely the reason that we're failing to serialize.
| Reporter | ||
Comment 5•20 years ago
|
||
http://lxr.mozilla.org/mozilla/source/calendar/libical/src/libical/icalcomponent.c#1350
strcmp is giving us garbage here. |string| is properly X-SOMETHING-COOL, but when i is 10 (and component_map[i].name is "X") it's returning -45, rather than the 0 that I would expect. This means we fail to match the right component type.
| Reporter | ||
Comment 6•20 years ago
|
||
This at least will parse the x-comp and spit it back out. The problem is that the name of the x-prop gets lost. Someone started implementing this here: http://lxr.mozilla.org/mozilla/source/calendar/libical/src/libical/icalcomponent.c#54
but a quick glance at http://lxr.mozilla.org/mozilla/search?string=x_name will show you it never got past defining the member. Someone with more c-foo than me is going to need to take care of actually storing that name here: http://lxr.mozilla.org/mozilla/source/calendar/libical/src/libical/icalparser.c#667
and reusing it here: http://lxr.mozilla.org/mozilla/source/calendar/libical/src/libical/icalcomponent.c#306
Attachment #233193 -
Flags: second-review?(dmose)
Attachment #233193 -
Flags: first-review?(mattwillis)
Comment 7•20 years ago
|
||
Comment on attachment 233193 [details] [diff] [review]
part one (checked in)
After dusting off my rusty C, this looks right.
We won't try to include the trailing \0 in the comparison.
r1=lilmatt
Attachment #233193 -
Flags: first-review?(mattwillis) → first-review+
Comment 8•20 years ago
|
||
Comment on attachment 233193 [details] [diff] [review]
part one (checked in)
r=dmose
Attachment #233193 -
Flags: second-review?(dmose) → second-review+
| Reporter | ||
Comment 9•20 years ago
|
||
Comment on attachment 233193 [details] [diff] [review]
part one (checked in)
patch checked in.
Attachment #233193 -
Attachment description: part one → part one (checked in)
| Reporter | ||
Updated•20 years ago
|
Summary: Failure to serialize X-Components → All X-Compnents are serialized with BEGIN:X, rather than BEGIN:X-FOO
Whiteboard: [swag:2d] → [swag:1d]
Updated•20 years ago
|
Summary: All X-Compnents are serialized with BEGIN:X, rather than BEGIN:X-FOO → All X-Components are serialized with BEGIN:X, rather than BEGIN:X-FOO
| Assignee | ||
Comment 10•20 years ago
|
||
This patch does what jminta described in comment 6.
Sorry about the tab mess, that's just libicals fault.
Attachment #234605 -
Flags: first-review?(dmose)
| Reporter | ||
Updated•20 years ago
|
Whiteboard: [swag:1d] → [swag:1d][patch in hand]
Updated•20 years ago
|
Whiteboard: [swag:1d][patch in hand] → [swag:1d][patch in hand][needs review dmose]
Updated•20 years ago
|
Whiteboard: [swag:1d][patch in hand][needs review dmose] → [swag:1d][patch in hand][needs review dmose][no l10n impact]
| Assignee | ||
Updated•20 years ago
|
Attachment #234605 -
Flags: second-review?(dmose)
Attachment #234605 -
Flags: first-review?(dmose)
Attachment #234605 -
Flags: first-review?(daniel.boelzle)
Comment 11•20 years ago
|
||
(In reply to comment #10)
> Created an attachment (id=234605) [edit]
> patch libical
Looks good, only minor nits:
> + icalcomponent* comp = icalcomponent_new_impl(kind);
> + comp->x_name = icalmemory_strdup(x_name);
> + return comp;
check for out-of-mem:
if (comp != 0)
comp->x_name
> kind_string = icalcomponent_kind_to_string(kind);
> + if (kind == ICAL_X_COMPONENT) {
> + kind_string = impl->x_name;
> + }
minor opt:
else
kind_string = icalcomponent_kind_to_string(kind);
r1=dbo
Updated•20 years ago
|
Attachment #234605 -
Flags: first-review?(daniel.boelzle) → first-review+
Comment 12•20 years ago
|
||
Comment on attachment 234605 [details] [diff] [review]
patch libical
>+/** @brief Constructor
>+ */
>+icalcomponent*
>+icalcomponent_new_x (icalcomponent_kind kind, const char* x_name)
Unless I'm misunderstanding something, kind is always going to be ICAL_X_COMPONENT, so there should be no need for the kind argument at all.
r2=dmose with dbo's comments addressed and that fixed.
Attachment #234605 -
Flags: second-review?(dmose) → second-review+
Updated•20 years ago
|
Whiteboard: [swag:1d][patch in hand][needs review dmose][no l10n impact] → [swag:1d][patch in hand][needs updated patch][no l10n impact]
Updated•20 years ago
|
Assignee: nobody → mvl
Whiteboard: [swag:1d][patch in hand][needs updated patch][no l10n impact] → [needs updated patch]
Updated•20 years ago
|
Whiteboard: [needs updated patch] → [needs updated patch and checkin]
| Assignee | ||
Comment 13•20 years ago
|
||
Updated patch, ready for checkin
Attachment #234605 -
Attachment is obsolete: true
Attachment #238998 -
Flags: second-review+
Attachment #238998 -
Flags: first-review+
| Assignee | ||
Updated•20 years ago
|
Whiteboard: [needs updated patch and checkin] → [needs checkin mvl]
| Assignee | ||
Comment 14•20 years ago
|
||
patch checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Whiteboard: [needs checkin mvl]
Updated•14 years ago
|
Whiteboard: [libical-upstream?]
You need to log in
before you can comment on or make changes to this bug.
Description
•