XMPM 1.3 Patches for OpenSync

Possible status for patches:

Possible patch status:

  • NRY: Not Reviewed Yet;
  • NI: No Inclusion - The change will not be included in OpenSync;
  • PI: Possible Inclusion - may enter svn, but needs some modifications;
  • RFI: Ready For Inclusion - patch has been reviewed and is ready to be committed to svn;
  • AI [rev]: Already Included - patch already included on svn, or equivalent funcionality already included on svn revision [rev].

Please include the number of the revision where it was included on svn.

kdepim plugin patches

See XmpmPatches/kdepim.

libopensync patches

XMPM changes against OpenSync revision 873

  • Patches marked with '*' are considered XMPM-specific.
  • All patches should be applied consecutively in ascending order.
001-disable_werror.patch NI Disable -Werror compilation flag
002-ignore_group_field.patch NI Ignore "group" field in mobile We should handle X- field in a common way
003-handle_unknown_node.patch PI Handle unknown node attribute How should we handle unknown fields in devel-branch? (At least the patch is leaking memory. return value of osxml_find_node() must be freed.
004-unknown_parameters.patch PI Fix typo on xml-vcard code: use "UnknownParam?" instead of "UnknownParameter?". Fix handling of unknown parameters and attributes on vcalendar support Indeed there is a "UnkownParam?" typo which should be fixed. The patch is memory leaking. Return value of xmlNodeGetContent(), osxml_find_node() get not freed. The handling needs to be reviewed.
005-vcard_sound_fix.patch NRY Many fixes to SOUND field handling on vcard: Escaping fixes/workarounds: handle weird escaping coming from mobile and don't escape backslashes on vcard 2.1. Add explicit "TYPE" name on parameters even on vcard 2.1, if they were explictly specified on the original vcard input. Use a "ExplicitType?" XML element for that. Don't use quotes if parameter name contain only alpha-numeric and '-'. Remove generation of "TYPE" parameter when handling sound and images attributes. They are automatically added by the handler of "Type" parameter. Fix XML generation/handling of unknown parameters to correctly add the parameter name and the parameter contents.
006-fields_scores.patch NRY Field score settings
007-name_comparasion_fix.patch AI [1542] Compare only nodes with same name. Skip if the names are different
008-empty_xml_nodes.patch NRY Handle empty XML nodes
009-line_folding_bug.patch NRY Doens't break lines longer than 75 chars anymore due to an incompatibility with X75's VCARD 2.1 implementation
010-xmpm_mappings.patch NRY Adding new kdepim/contacts mappings
011-changelog_with_data.patch NRY Put change data into OpenSync changelog, so that we can implement Ignore conflict resolution without read_change() implementation on syncml plugin (i.e. the mobile doesn't implement Get command)
012-prefer_exact.patch NRY Make OpenSync prefer exact matches when searching for similar ADD mapping entries
013-initialization_priority.patch NRY Fix for hanging at sync initialization
014-clear_mappings_on_stale_lock.patch NRY Clear the mapping table if a stale lock file is found (interrupted synchronization). This will solve some problems of a invalid mapping table being kept when synchronization is interrupted
015-duplicate_fix.patch NRY Don't set dirty flag on the mappingentry on newly created maps. It makes the change to be written back to the original member. Don't convert ADDED changes to MODIFIED incorrectly on multiply_master
016-modify_not_add.patch NRY Use CHANGE_MODIFIED, not CHANGE_ADDED, on "master changes" on duplicate. Clear UID of the changes being copied, so their original UIDs aren't reused on the ADDs
017-OpenSync_no_elevate.patch NRY Remove wrong "elevation" of changes on duplicate
018-duplicate_sane_uids_on_mappings.patch NRY Make osync_change_duplicate() even if there is no duplicate func. This fix is necessary to avoid not-unique UIDs on the same member after a duplicate. These not-unique UIDs would be fixed after a Add being successfuly run, but are harmful if the synchronization is interrupted
019-sqlite_memory_leaks_and_api_usage.patch AI [1851] Fixing various small memory leaks and wrong sqlite3 api usage by OpenSync
020-debug_timestamps.patch NRY Print usec timestamps with correct fixed number of digits
021-debug_memory_leak.patch NRY Fixing a small memory leak
022-create_OpenSync_dir.patch NRY Make OpenSync automatically create the configuration directory even if it not the default $HOME/.OpenSync dir
023-several_memory_leaks.patch NRY A hunk of leak fixes
024-merge_ipc_branch.patch NRY Merging IPC branch from OpenSync.org (revision 885)
025-debug_timestamps.patch NRY Fixing timestamp printing
026-debug_instead_of_printf.patch NRY Replace debugging printf()s with osync_trace() We are not supposed to debug using printf(), but osync_trace()
027-evolution_display_name.patch AI [r1190] Fixing regression of display name conversion. OpenSync format extensions do not work like (seems) expected by this "file as" change
028-doxygen_fixes.patch NRY Doxygen fixes
029-identation_cosmetics.patch NRY Indentation fixes
030-private_as_static.patch NRY Declaring private functions as static
031-trace_calls.patch NRY Missing osync_trace() calls
032-trace_calls_fixes.patch NRY osync_trace() calls fixes
033-trace_calls_pairing.patch NRY osync_trace() calls pairing
034-trace_cosmetics.patch NRY osync_trace() calls pairing and some fixes to error messages
035-code_cosmetics.patch NRY Lots of whitespace & weird indentation (no changes to code)
036-more_cosmetics.patch NRY 1 more indentation fix
037-fullname_formattedname.patch NRY Fixing change of attribute 'FullName?' to 'FormattedName?' from OpenSync upstream merge
038-missing_headers.patch NRY Add missing headers to EXTRA_DIST
039-identify_member.patch NRY Adding trace message to identify member (like the old one) and fix a typo
040-marshall_demarshall.patch NRY Implement marshall/demarshall functions for internal xml formats. They are needed for cases when a xml-contact/xml-event/etc is sent through the IPC queues
041-dont_leak_fd.patch NRY Don't leak the file descriptor
042-changes_without_format.patch NRY Allow changes without format set on osync_marshal_changedata(). Changes without a format set are possible. For example, Deletes don't have data and format set. Don't abort on these cases, but just send empty data
043-identation_fixes.patch NRY Oops, fixing spaces X tabs..
044-pass_options_to_osplugin.patch NRY Query OSYNC_* environment variables when getting OSyncEnv options. With this, we will be able to easily pass all OSyncEnv options to osplugin, by just setting the right environment variables
045-environment_variable_fix.patch NRY Fix osync_env_query_option(), implement osync_env_export_all_options(). Fix environment variable name on osync_env_query_option(). Implement osync_env_export_all_options(). Call osync_env_export_all_options() before running osplugin. This will solve the problem of osplugin not looking at ~/.xmpm/OpenSync because the group directory setting weren't being passed to it
046-create_engines_directory.patch NRY Create engines directory if necessary. This will make OpenSync not fail if the ~/.OpenSync/engines directory doesn't exist when running a synchronization
047-send_uid_of_the_change_back.patch NRY Send UID of the change back to engine on commit_change() reply. The plugin may have generated a new UID after committing the change. The commit change reply will return the new UID of the change. This will solve problems of the engine crashing after a delete: it was being caused by an invalid mapping entry being set when a new UID was generated by the plugin after an Add
048-gmalloc0.patch NRY Use g_malloc0() instead of malloc(). We need some fields on 'context' to be set to 0 by default. For example: the add_reply_data callback should be NULL by default
049-implement_mkdir_with_parents.patch NRY Implement our own version of g_mkdir_with_parents() g_mkdir_with_parents() are available only in GLib 2.8, but we want to support older versions of GLib (e.g. the Glib available on CL10)
050-same_vs_similar_problem.patch NRY Fix for SAME x SIMILAR problem. When is created the same contact, with following fields: First Name, Last Name, Home Phone, Work Phone, Cell Phone; and make a slow sync is generated a conflit between contacts instead of been related as the same contact. Further this, if conflit resolution policy DUPLICATE is chosen the sync server is aborted due an crash in kdepim plugin
051-free_ctx.patch NRY Free ctx only after calling add_reply_data(). Oops, I was passing a already-freed ctx object to add_reply_data(). This was causing some random crashes
052-broadcast_slowsync_request.patch NRY Added support to plugin broadcast a slow-sync request. The plugin return in connect reply the objtype that must perform slow-sync and osengine broadcast this information to others plugins in get_changes message.
053-strange_messages.patch NRY Perfoming a synchrnonization with members that just share contacts, some messages about other kinds of data appears. These messages maybe have something related with synchronization of the related kind of data, but them should not appear in a sync of only contacts. This patch fix this bug
054-vformat_as_lib.patch NRY OpenSync vformat helper is now exported as shared lib, for reuse in plugins
055-cosmetics.patch NRY aesthetics (deleted spaces)
056-compilation_warnings.patch NRY Fix warnings caused by missing 'const' There were missing 'const's on input parameters of osxml_marshall/osxml_demarshall
057-trace_cosmetics.patch NRY Use <<<<< on TRACE_EXIT_ERROR, also "<---" Make usage of foldmethod=marker on vim more difficult
058-missing_break.patch NRY Add a missing break to switch on osync_trace
059-pass_group_dir_to_osplugin.patch NRY Pass group config dir to osplugin The group we are synchronizing may have been loaded manually using osync_group_load(). So change osplugin to get the group path from the command line arguments, not the group name. As a bonus, we make osplugin more efficient by avoiding loading configuration for all groups because we already know where the group we want is located
060-stop_queue_on_finalize.patch NRY Stop engine queue threads on osengine_finalize() The threads are started on osengine_init(), so they need to be stopped on osengine_finalize(). This fixes some unit tests on check_lock.c
061-marshall_errors.patch NRY Marshall/demarshall errors when sending/handling error replies. Remove the error field on OSyncMessage and use the message data buffer to marshall/demarshall the error information on OSYNC_MESSAGE_ERRORREPLY messages. Do the same thing on OSYNC_MESSAGE_ERROR messages (though they aren't handled by the engine currently)
062-encoding_in_organization_hook.patch AI [1356] Added encoding support in organization hook. add_value() was splitted for code reusage
063-command_queue_per_plugin.patch NRY Replace engine->commandQueue and engine->incoming by engine->commands_to_self and engine->commands_from_self, for clearity. Replace client->incoming by client->commands_to_osplugin. Create client->commands_from_osplugin, to receive commands from osplugin. With this, we have a different command queue for each plugin, and we won't have the race condition
064-get_changedata.patch NRY Implement get_changedata() method support Implement handling of GET_CHANGEDATA on osplugin and implement osync_client_get_changedata()
065-dont_call_finalize_if_not_initialized.patch NRY Don't call osync_member_finalize() if osync_member_initialize() has failed. The plugin finalize() method isn't supposed to be called if initialize() has failed. Althought the engine needs to be able to send a FINALIZE command to osplugin to finish the osplugin process. So, if the engine send us a FINALIZE when osync_member_initialize() has failed, just exit from osplugin. This fixes osplugin crashes on the Plugin unit test, and maybe other unit tests, also
066-export_list_of_modules.patch NRY Export the list of modules loaded to osplugin Export the whole list of modules that were loaded to osplugin, through the OSYNC_MODULE_LIST environment variable
067-func_to_read_write_slowsync_info.patch NRY Create functions for the writing/reading of slow-sync information. This will avoid duplicated code on other places that reading/writing slow-sync settings to/from osplugin will be needed
068-send_slowsync_settings_on_connect.patch NRY Send slow-sync settings to osplugin on connect() requests, also. This fixes a bug that made sync_easy_new_del() unit test fail, because the slow-sync flags weren't being reset on osplugin in a second synchronization
069-cal_require_before_set_objtype.patch NRY Call osync_member_require_sink_info() before osync_member_set_objtype_enabled(). This is required by osync_member_set_objtype_enabled() interface. Without this, the loading of objtype_enabled information may fail, making objtype_enabled configuration be ignored (and all object types would be synchronized)
070-fd_cloexec.patch NRY Set FD_CLOEXEC flag on lock file descriptor. We don't want the lock file to be kept open if the sync engine is finished and other child processes (osplugin or processes started by libraries used by plugins) keep running. It solve some "Group is locked" problems, but at a sync engine abort, osplugin processes may still continue running (and may cause problems on further synchronizations). This will be fixed in the next commit
071-track_osplugin_pid.patch NRY Track osplugin PIDs and kill old osplugin processes on new syncs. It keeps the PID of the osplugin processes on the 'osplugin.pid' file inside the member configuration directory. If a pid file is found on osync_client_initialize(), the old process is terminated with SIGTERM
072-cleanup_unused_label.patch NRY Clean up not used goto label
073-cleanup_unused_var.patch NRY Deleted not used variable
074-fix_memory_leak_on_db_close.patch NRY Fix a memory leak on osync_db_close(). osync_db_close() wasn't free()ing the OSyncDB object allocated on osync_db_open(). Fixing this. Changing osync_db_open() to not use osync_db_close() on error handling (we don't necessarily need to do everything that osync_db_close() does, if the DB initialization fails). Adding a commented 'error_free' label to make clear we have multiple steps in the error handling (althought the label is commented not used, it may be needed if the initialization code changes)
075-cleanup_unused_func.patch NRY Removing unused function _osync_change_check_level() isn't used since a long time. Removing it
076-wait_old_osplugin_terminate.patch NRY Wait old osplugin process to terminate, when killing it. As we quickly start another osplugin process, the old osplugin process may be still terminating after we sent a SIGTERM to it. Fixing this by checking osync_queue_is_alive() after sending a SIGTERM to osplugin. Wait at most 10 seconds for it to terminate, in this case use SIGKILL. This fixes hangs in the dual_sync_engine_unclean() unit test, caused by old osplugin processes getting the initialize message from the engine. Addding FIXME marks because the wait times are hardcoded in the code
077-cleanup_unused_func.patch NRY Removing unused functions These functions were just skeletons for the actual implementation, but the implementation was done on OpenSync_queue.c. (This is an import of revision 989 from svn.OpenSync.org)
078-add_todo_marks.patch NRY Adding some TODO marks to suspect code
079-remove_commented_code.patch NRY Remove commented code that was already implemented Remove code that was already implemented on engine_message_handler() and add a TODO note about the remaining commented code
080-tasks_and_events_mapping.patch NRY Prototype tasks&events attribute 'mappings' for the mobile
081-textonly_note_format.patch NRY Introduce "textonly-note" format The "textonly-note" format will be used for notes that are just a block of text, being the first line the not summary, and the remaining lines, the note body. This include the notes returned as text/plain from the mobile
082-use_statusparam.patch NRY Use a "StatusParam?" element to represent a "STATUS" parameter A "STATUS" vcalendar _attribute_ becomes a "Status" element in the XML data, and a "STATUS" _parameter_ was being converted to a "Status" element in the XML data, also. However, the same hashtables are used to the functions that handle vcalendar attributes and for the functions that handle vcalendar parameters. This way handle_xml_status_attribute() was being called when handling the Status parameter for the "ATTENDEE" attribute. This was making the vcalendar data become corrupted, and could cause crashes. This fixes the problem reported by using a different name for "Status-parameters": "StatusParam?". This way we may have a function to handle Status parameters in the hashtable, and generate a STATUS parameter on the ATTENDEE lines properly
083-discard_categories.patch NRY Discard categories, as they are translated by the mobile, and so, of no much use, and causing conflicts
084-kde_mappings.patch NRY Changes for VCALENDAR:VEVENT KDE mappings. Adding DALARM (DisplayAlarm?) specific handling, ignoring some of its values for now, as KDE always puts defaults, but the mobile does not use them. 1st try at handling the CATEGORIES:Call situation. Ignoring AALARM in comparison, as KDE does not handle it, and it is the same as DALARM
085-remove_no_group.patch NRY Removing kdepim "No group" X-SIE-CATEGORIES handling hack, as the Group attribute is to be discarded for now, and the new mobiles ("Swift") don't use "No group" for empty groups
086-nul_terminitor_on_change_data.patch NRY Add nul terminator to change data. Many plugins assume that the change data is a nul-terminated string. Add a nul terminator to the change data to make the life easier to plugin writes
087-ignore_fields.patch NRY Proper way to ignore fields in comparison
088-fix_on_compare_changes.patch NRY Fix for case when the right side change has more nodes than the left side change, and all nodes on the left have matches on the right. Also some whitespace cleanup
089-cleanup_unused_stuff.patch NRY Cleanup whitespace and commented unused code
090-cleanup_unused_func.patch NRY Cleanup removing create_vcard30() function, (not) used only for OpenSync unit testing
091-remove_format_detection.patch NRY Cleanup: removing "format detection", as we don't need nor want to have our KDE semi-custom VCARD3.0 format "detected". It also was no different from regular VCARD3.0
092-remove_phonecall_attr.patch NRY 'Phonecall' attribute is gone
093-vevent10_mappings.patch NRY Adding xmpm-kde-vevent10 format to better control KDE events mappings
094-trace_messages_for_errors.patch NRY Trace messages for errors. It is harder to debug without having aids
095-error_checking_on_queue_read.patch NRY Error checking. This should solve an endless loop case, when _osync_queue_read_data() returns -1 (error)
096-error_checking_on_queue_write.patch NRY Error checking. This should solve an endless loop case, when _osync_queue_write_data() returns -1 (error)
097-cosmetics.patch NRY Semi-cosmetic
098-more_debugging_aids.patch NRY More debugging aids: show erroring fd
099-handler_for_aalarm_attr.patch NRY Handlers for the AALARM attribute
100-special_format_for_xmpm_vtodo.patch NRY Creating "special" formats xmpm-kde-vtodo{10,20}. Including conversion of AudioReminder? and DisplayReminder? to vcalendar 2.0 attributes
101-add_new_error_code.patch NRY Adding OSYNC_ERROR_APP_RUNNING error code
102-dont_compare_categories.patch NRY Don't compare categories, the mobile rules
103-zero_dtstart_score.patch NRY DTSTART is handled differently by kde X mobile. (The mobile sets it at creation, KDE allows setting it.)
104-priority_mapping.patch NRY Priority mapping. This file would love to be refactored and cleaned up
105-handle_egain.patch NRY Handling EAGAIN on read(). This hack works fine for me and can be used until we merge the OpenSync mainstream that fixes this bug using io_channels with non-blocking I/O
106-disregard_difference.patch NRY Disregard difference in the completion time of tasks
107-code_documentation.patch NRY A little documentation
108-type_uppercase.patch NRY The mobiles need TYPE paremeter values in upper case
109-new_error_code.patch NRY Adding OSYNC_ERROR_NOT_ENOUGH_SPACE error code
110-strange_mobile_linefolding.patch NRY Treat '=\r\n' style linefolding, because (some?) BenQ-Siemens mobiles do it
111-fields_adaptations.patch NRY Fixes for disregard Organization/Department field in comparison. Reset emails counter for every vcard conversion. Trim postalcode, because BenQ-Siemens mobiles have only 8 chars sized field
112-workaround_mobile_vcard20.patch NRY Hack to workaround the lack of compliancy with VCard 2.0 standard of some BenQ-Siemens mobiles that produces VCards with non-escaped semicolons
113-made_abort_effective.patch NRY Make osengine_abort() effective
114-avoid_nulls.patch NRY Avoid NULLs
115-pass_error_variable_instead_of_null.patch NRY Pass the error variable instead of NULL. Passing NULL causes the syncserver to segfault, if an error actually happens, due to some later assertions
116-synchronization_cancelling.patch NRY Hopefully completing synchronization cancelling implementation: adding a osengine_stop() function, to take the place of osengine_abort(), which now has another meaning. Making osplugin treat the SIGUSR2 signal to mean aborted sync; this is an "out of band" way to tell it about aborted sync immediately, so it stops processing any other messages than disconnect, followed by finalize. Making osengine_abort() send SIGUSR2 to the clients, right after sending the disconnect message, so the plugins know immediately the synchronization was cancelled, and disconnect and finalize are the next messages to be processed. On sync abortion, set the engine->error, so proper cleanup, and slow sync, occurs in the next synchronization
117-avoid_conflicts_raised_by_unknown_fields.patch NRY See description below
   Add the list of all known fields to compare_contact(), followed by
   "/contact/*" with score=0.

   Added a small change to osxml_compare() to make it not ignore completely
   the node if it matches two rules and the last one has score=0. Otherwise,
   the "/contact/*" rule would make every node be ignored, even the
   ones that were on the score table

   Removed duplicated compare_contact(), get_revision() and other
   'xml-contact' methods from xmpm-kde-vcard.c. These methods need to be
   registered only once

   Added field table for events/appointments

   Change score of "primary key" fields to 200

   We have some fields with score=1 now. If the "primary key" fields match
   but the score=1 fields don't match, we will have a comparison score
   result smaller than 99. But we want a comparison result higher than 99
   when the "primary key" fields match, so we get SIMILAR as result when
   those fields match, instead of DIFFERENT. Changing their score to 200
   will ensure that. Adding field table for Todo items

   List of fields from the field mapping document
   Uncomment /vcal/Event/Class and fix score table on compare_vtodo()

   /vcal/Event/Class was commented out for testing

   The score table on compare_vtodo() had some /vcal/Event entries (instead
   of /vcal/Todo), and the "/vcal/*" entry was missing
118-move_list_of_ignored_fields.patch NRY Move the list of ignored fields to the beginning of the list The first thing to do is to remove the data that should be ignored from the XML trees, because we may want to match some nodes that contains some to-be-ignored fields. For example: if /vcard/Organization/Department needs to be ignored, the table entry for /vcard/Organization/Department should appear before /vcard/Organization, otherwise we will have a mismatch when checking /vcard/Organization, because Department wasn't removed from the xml tree yet
119-add_categories_and_org_to_ignore_list.patch NRY X-ESI-CATEGORIES and Organization/Department re-added to list of ignored fields. Ouch, hurt by duplicated code. :\ There were two compare_contact() functions in the code, and I've removed the one that had more fields on its score table
120-comment_old_and_unused_code.patch NRY Commenting out what seems to be old, bugged, unused code
121-mod_vs_del_conflict_fix.patch NRY When solving MOD x DEL conflicts, with MOD winning, it seems safer to do an ADD instead of MOD, because the member with DEL may have trouble with MODing a DELeted entry. Fix the use case when the mobile rejects with error a MOD for a DELeted entry)
122-change_sanity_check.patch NRY Some BenQ-Siemens mobiles reports a MODIFIED in some cases when is necessary to report an ADDED. Added a sanity check to workaround this mobile bug
123-change_textonly_note_scheme.patch NRY Change textonly-note to have the summary built from the first N characters of the body text. Also fixing the comparison score for the new comparison scheme implemented
124-off_by_one.patch NRY Off-by-one or such with summary_sz, and comments
125-notes_score_adjusts.patch NRY Score list should have a wildcard match at the end, to avoid retrying to match unmatched attributes. Fixing string size limit in snprintf(). Fixing comment
126-lowering_similarity_thresold.patch NRY Lowering similarity thresold, so notes with same body but different title are similar, not different
999-convert_to_xmpm NRY Convert OpenSync build system to XMPM build system and others XMPM specific changes. Probably you will not apply this patch