Community
Participate
Working Groups
With the recent changes made as part of bug 161734 the behavior of query synchronization for Trac tasks accessed in Web mode (no task data) has changed. I'll use this ticket to list the things that need to be fixed: * Tasks are not marked as read when the editor is opened (they remain to be marked as "new") * Tasks are synchronized twice when the editor is opened * When a query is synchronized all previous hits (?) are moved to the archive Steps to reproduce: 1. Create a Trac repository choosing the Edgewall repository template 2. Create a query that filters by summary containing "XML"
Eugene, have you checked synchronization of web tasks?
Nope. BTW, it would be nice if we can somehow reuse code between web connector and trac for that.
Please note that all the recent changes run a risk of destabilizing the Trac and Generic Web connectors for RC1. Rob and I are trying to do what we can to avoid that. The Trac connector has a great test suite which will help.
One of the problems is that QueryHitCollector does not preserve (attributes of) existing tasks such as lastSyncDateStamp when receiving hits as tasks. Before query hits and tasks were merged that problem did not exist since only query hits were replaced and the associated task was not touched. I am not sure what the best solution is here: keep the existing task and copy new attributes or replace the existing task and preserve the meta data. I am leaning to towards the latter because that only requires knowledge about the common task model and could be done in the framework. Lets discuss this on bug 191575.
Created attachment 71386 [details] mark web tasks read when opened The patch has mostly formatting changes. The only semantic change is that the sync timestamp is set to a "bogus" date when a task is opened similar to the handling of local tasks.
Created attachment 71387 [details] mylar/context/zip
Path currently won't take in my workspace... did you still want this one applied?
Created attachment 71407 [details] updated patch I have limited the patch to the implementation change. It fixes the sychronization state decoration for web tasks so it would be nice to have if you think it's the correct way to fix it.
Created attachment 71675 [details] updated patch
*** Bug 193041 has been marked as a duplicate of this bug. ***
(In reply to comment #8) > I have limited the patch to the implementation change. It fixes the > sychronization state decoration for web tasks so it would be nice to have if you > think it's the correct way to fix it. Patch applied. Note there is a Bugzilla short coming that can cause the last changed task to get synched again resulting in erroneous incoming on a task marked as read (when no offline data exists), but this condition is an outlier. Lets work with it and watch.
When a task changes remotely and already exists in the task list query synchronization does not pick up the changes. The reason is that TaskList.add() does not replace existing tasks. There are two options to fix this: 1) replace the existing task by removing it first 2) copy the properties from the new task to the existing task 1: This could be tricky because the task object might be used elsewhere (e.g. in the editor) and we would have to make sure that we do not loose any of the Mylyn managed properties like the notes when replacting the task. 2: Part of this has to be done by the connector similar to what is now in updateFromTaskData() only that the new method would be called updateTaskFromTask(). A default implementation could be provided that copies all properties of AbstractTask which would be sufficient for most connectors and it could be overridden by connectors for any custom properties. I am leaning towards the latter and will start working on a patch soon if there are no objections.
2 sounds right to me. A patch would be great!
Created attachment 71826 [details] fix upating of tasks from hits Here is a patch that updates existing tasks from query hits. I changed the name of the method that mirgrate the query hit properties to the existing task to updateTaskFromQueryHit() (instead of naming it updateTaskFromTask()). The patch is not beautiful but it's the best I could come up with. Rob, please review carefully and apply.
Created attachment 71827 [details] mylar/context/zip
Looks like this patch breaks background synchronization of incoming. Change a couple tasks remotely then Synchronize Changed from toolbar doesn't result in new incoming. I can sort this out in the morning but if you have a spare minute in the morning....
I'll try to reproduce it.
Created attachment 71887 [details] fixed incoming notification Thanks for testing Rob. SynchronizeQueryJob checked the stale flag on the hit and not on the existing task. It's fixed in the updated patch.
Created attachment 71888 [details] mylyn/context/zip
ITaskListExternalizer slipped into the patch. Rob, just exclude that file when applying the patch.
I put ITaskListExternalizer back. Excluding it was a mistake commit for progress on bug 166609. That bug is evil.
Created attachment 71910 [details] updated patch
Patch reviewed and applied. Thanks Steffen.
Thanks for all the testing Rob.