Menu

#205 week 53? 2016 last week issue

2.4
closed-fixed
None
5
2020-01-08
2016-12-28
Raveesh
No

Rachota stopped logging events since Sunday the 25th. It counts this week as week 53? See attachment.

1 Attachments

Discussion

  • Jiri Kovalsky

    Jiri Kovalsky - 2016-12-29

    Yes, I am unfortunately aware of this issue which is recurring every year in the last week. The good news is that it will start working correctly from the next week again.

    If I don't find time for looking into this by mid January, please ping me. I am very busy now :(. Thanks for your bug report!

     
  • Fry

    Fry - 2016-12-30

    I have started looking at this problem, I found that the problem is in Plan.jave | line 266 in method getNextWeekToSave.

     if (maxWeek == calendar.getMaximum(Calendar.WEEK_OF_YEAR)) maxWeek = -1;
    

    If maxWeek = 53 so maxWeek will be set to -1 and plan will not be save.
    Not sure to be sure why we need this test, but I suggest to change it like:

     if (maxWeek > calendar.getMaximum(Calendar.WEEK_OF_YEAR)) maxWeek = -1;
    
     
    • YANG, Bo

      YANG, Bo - 2016-12-30

      The test has something to do with

      int maxWeek = calendar.getMaximum(Calendar.WEEK_OF_YEAR);
      

      which is about 10 lines above

      if (maxWeek == calendar.getMaximum(Calendar.WEEK_OF_YEAR)) maxWeek = -1;
      

      If your change is to be made, the following change is also needed:

      int maxWeek = calendar.getMaximum(Calendar.WEEK_OF_YEAR)+1;
      

      so that maxWeek would be initialized as an invalid week number and if there is no more day in plan after given week, maxWeek will be assigned -1 to exit the while() loop in savePlan().

      The side effect is the creation of "diary_2017_53.xml" and "diary_2017_54.xml".

       

      Last edit: YANG, Bo 2016-12-30
      • MSA

        MSA - 2016-12-31

        The side effect is the creation of "diary_2017_53.xml" and "diary_2017_54.xml".

        Is this really 2017, or did you mean 2016?

         

        Last edit: MSA 2016-12-31
        • YANG, Bo

          YANG, Bo - 2016-12-31

          They are 2017. "diary_2016_53.xml" was created, which is desired. "diary_2017_53.xml" and "diary_2017_54.xml" are unexpected.

           
  • Gedeon

    Gedeon - 2016-12-30

    Hi everyone,
    I'd like to share the fact that I have the same problem but with a little variation in the symptoms.
    The same problem: The tasks of Dec 26th to 29th (52th week) were correctly saved until I shut down windows for the first time since december 25th, tonight. This morning, when I turned windows7 on again, and then Rachota, all the tasks of week 52 had gone (Dec 26,27,28 and 29).
    The Difference from Raveesh's case is that Rachota displays "week 52", not 53, but there is no trace of a diary_2016_52.xml file in the diary folder. Instead, I find "diary_2017_51.xml" and "diary_2017_52.xml".

    Just in case: is there a way to recover the lost days?

    Thanks for yor help. I like this software. Benn using it for a few weeks, and this is teh first major issue I had. Thanks for the work on this project.

    gedeon

     
  • Raveesh

    Raveesh - 2016-12-30

    hi Fry and everyone, I am using the Java executables only, so I can't change the code at my end.

    Also, I see that the system has messed up the date and week nr. 30 Dec 2016 is week nr 53. This is because the system messed up in Dec 2015. Dec 27th Dec 2015 is shown as week 1 in my Rachota, where as it should have been 53 (as per Google cal). So throughout 2016 the week info has been wrong (I never paid attention).

    I have been using Rachota for almost 6 years now. Rachota is simple and so far I am only using it to see where did my time go. Rachota also serves its purpose. I guess for more efficient project management one would need to use other tools. But thanks for this tool.

    The issue with last week of year also occured in 2011 for me (see my tickets).

     

    Last edit: Raveesh 2016-12-30
  • Jiri Kovalsky

    Jiri Kovalsky - 2019-02-15

    FYI, I have finally found a reproducible case and start to look at this:

    • Set system time to 29th of December 2016
    • Launch Rachota and create a new task
    • Exit Rachota and launch it again
      Expected: Task created in step 2 will be displayed
      Actual: Task created in step 2 is gone
     

    Last edit: Jiri Kovalsky 2019-02-15
  • Jiri Kovalsky

    Jiri Kovalsky - 2020-01-01

    I think I have a fix for this issue. I will be testing it for a couple of weeks and then plan to commit it to the reprository and publish the new build of Rachota 2.4.

     
  • Jiri Kovalsky

    Jiri Kovalsky - 2020-01-03
    • status: open --> closed-fixed
     
  • Jiri Kovalsky

    Jiri Kovalsky - 2020-01-03

    The bug is finally fixed in build #200102 by #410f2aece commit [1] . Tested on year ends 2016, 2018 and 2019. Previous saving mechanism didn't take year numbers into account when deciding which week to save next and also days were not sorted so older days modified later were not sometimes saved too.

    I would appreciate if somebody could verify the fix. Unfortunately, it cannot restore data which were not saved earlier by broken Rachota builds.

    [1] https://sourceforge.net/p/rachota/code/ci/410f2aece6461cccbb9cbbfaf0c036a515599c1d/

     
  • Jiri Kovalsky

    Jiri Kovalsky - 2020-01-08

    I am very sorry but one additional fix was needed in order to make sure that sorting of days in TreeMap works as expected. Now prefixing of single digit days IDs with zeros was introduced so that for example 2020_1_11 is not considered younger than 2020_1_2. Now it is 2020_01_11 and 2020_01_02 which sorts the days correctly.

    Please download the latest Rachota 2.4 build #200108.

    https://sourceforge.net/p/rachota/code/ci/157c9d43556e8c1454d529cd362b619dff9abf37/

     

    Last edit: Jiri Kovalsky 2020-01-08

Log in to post a comment.