Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 288309

Summary: detect changes using date compare when time zone available on repository
Product: z_Archived Reporter: Robert Elves <robert.elves>
Component: MylynAssignee: Robert Elves <robert.elves>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: steffen.pingel
Version: unspecified   
Target Milestone: 3.2.2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 261868    
Attachments:
Description Flags
patch in progress
none
mylyn/context/zip
none
updated patch with unit tests
none
updated
none
backported patch none

Description Robert Elves CLA 2009-09-01 18:54:12 EDT
With user customizable time zones now in Bugzilla, we can no longer rely on string comparison (for Bugzilla 3.4 and greater). We need to detect and use the timezone if available as per Steffen suggested approach on bug#288175 comment#4:

Problem: Bugzilla versions < 3.4 (?) included a hard-coded time zone or no time
zone information at all in the last modification date. Newer version support a
user configurable time zone and format the time stamp accordingly. This can
cause false incomings since time stamps are currently compared as strings.

Suggestion for migration of last modified time stamp:
1. Detect if modification date is a new time stamp

2a) old time stamp exits, repository uses old format
3. Compare by string

2b) old time stamp exits, repository now uses new format
3. Parse old time stamp as date
4. Compare old and new time stamps: assume no change if difference between old
time and new time is an exact multiplier of 1 hour and in the range of +/- 24h
5. Store new time stamp in new attribute, remove old time stamp (how will that
affect backwards compatibility?)

2c) new time stamp exits
3. Compare by date
Comment 1 Robert Elves CLA 2009-09-02 13:26:17 EDT
Created attachment 146301 [details]
patch in progress
Comment 2 Robert Elves CLA 2009-09-02 13:26:22 EDT
Created attachment 146302 [details]
mylyn/context/zip
Comment 3 Robert Elves CLA 2009-09-04 01:45:05 EDT
Created attachment 146472 [details]
updated patch with unit tests

I'm going to take the plunge and bootstrap on this. Steffen, if you could review that would be great.
Comment 4 Steffen Pingel CLA 2009-09-04 04:01:39 EDT
Patch looks good. Only minor nit I noticed is this chunk of code:

+				if (queryDate == null) {
+						event.setData(bCollector.getQueryTimestamp());

If we can't parse the date, wouldn't it be better to revert to the old strategy that checks task time stamps?
Comment 5 Robert Elves CLA 2009-09-04 11:34:05 EDT
Created attachment 146516 [details]
updated

Yes, good idea.  Patch updated.
Comment 6 Steffen Pingel CLA 2009-09-09 12:53:06 EDT
Created attachment 146776 [details]
backported patch

I have applied the patch to the branch.
Comment 7 Robert Elves CLA 2009-09-09 18:48:10 EDT
Great. I've committed the patch to head. Marking resolved