plusonelabs / calendar-widget

An calender widget for your Android home screen.
Apache License 2.0
370 stars 127 forks source link

Widget shows events on wrong dates #205

Closed Nikratio closed 7 years ago

Nikratio commented 9 years ago

Consider the attached screenshot. It shows a "Ribakovs" event on Saturday, and no event on Sunday:

screenshot_2015-09-30-12-57-04

However, the "Ribakovs" event is actually scheduled on Sunday, while a "Maker Faire" event on Saturday does not show up at all:

screenshot_2015-09-30-13-04-32

The event output is:

{
  "results": [
    {
      "executedAt": 1443642924779,
      "selectionArgs": [],
      "sortOrder": "startDay ASC, allDay DESC, begin ASC ",
      "standardMillisOffsetUtcToLocal": -28800000,
      "projection": [
        "event_id",
        "title",
        "begin",
        "end",
        "allDay",
        "eventLocation",
        "hasAlarm",
        "rrule",
        "displayColor"
      ],
      "uri": "content:\/\/com.android.calendar\/instances\/when\/1443642924779\/1444247724779",
      "selection": "selfAttendeeStatus!=2 AND (calendar_id = 3 OR calendar_id = 5 OR calendar_id = 1 OR calendar_id = 4 )",
      "rows": [
        {
          "title": {
            "value": "Mathworks Advisory Board Meeting",
            "type": 3
          },
          "eventLocation": {
            "value": "Manhattan Beach Marriott, 1400 Parkview Ave, Manhattan Beach, CA 90266, United States",
            "type": 3
          },
          "allDay": {
            "value": 0,
            "type": 1
          },
          "displayColor": {
            "value": -3312410,
            "type": 1
          },
          "rrule": {
            "type": 0
          },
          "event_id": {
            "value": 172,
            "type": 1
          },
          "hasAlarm": {
            "value": 0,
            "type": 1
          },
          "end": {
            "value": 1443742200000,
            "type": 1
          },
          "begin": {
            "value": 1443713400000,
            "type": 1
          }
        },
        {
          "title": {
            "value": "Company Meeting",
            "type": 3
          },
          "eventLocation": {
            "value": "",
            "type": 3
          },
          "allDay": {
            "value": 0,
            "type": 1
          },
          "displayColor": {
            "value": -3312410,
            "type": 1
          },
          "rrule": {
            "type": 0
          },
          "event_id": {
            "value": 160,
            "type": 1
          },
          "hasAlarm": {
            "value": 0,
            "type": 1
          },
          "end": {
            "value": 1443729600000,
            "type": 1
          },
          "begin": {
            "value": 1443726000000,
            "type": 1
          }
        },
        {
          "title": {
            "value": "Maker Fair",
            "type": 3
          },
          "eventLocation": {
            "value": "Balboa Park, San Diego, CA, USA",
            "type": 3
          },
          "allDay": {
            "value": 0,
            "type": 1
          },
          "displayColor": {
            "value": -6644481,
            "type": 1
          },
          "rrule": {
            "type": 0
          },
          "event_id": {
            "value": 1078,
            "type": 1
          },
          "hasAlarm": {
            "value": 0,
            "type": 1
          },
          "end": {
            "value": 1443898800000,
            "type": 1
          },
          "begin": {
            "value": 1443891600000,
            "type": 1
          }
        },
        {
          "title": {
            "value": "Henry Ribakovs's birthday",
            "type": 3
          },
          "eventLocation": {
            "value": "",
            "type": 3
          },
          "allDay": {
            "value": 1,
            "type": 1
          },
          "displayColor": {
            "value": -7151168,
            "type": 1
          },
          "rrule": {
            "type": 0
          },
          "event_id": {
            "value": 978,
            "type": 1
          },
          "hasAlarm": {
            "value": 0,
            "type": 1
          },
          "end": {
            "value": 1444003200000,
            "type": 1
          },
          "begin": {
            "value": 1443916800000,
            "type": 1
          }
        },
        {
          "title": {
            "value": "Ribakovs",
            "type": 3
          },
          "eventLocation": {
            "value": "XXXed out",
            "type": 3
          },
          "allDay": {
            "value": 0,
            "type": 1
          },
          "displayColor": {
            "value": -6644481,
            "type": 1
          },
          "rrule": {
            "type": 0
          },
          "event_id": {
            "value": 1080,
            "type": 1
          },
          "hasAlarm": {
            "value": 0,
            "type": 1
          },
          "end": {
            "value": 1443988800000,
            "type": 1
          },
          "begin": {
            "value": 1443974400000,
            "type": 1
          }
        },
        {
          "title": {
            "value": "Mathworks Conference",
            "type": 3
          },
          "eventLocation": {
            "value": "",
            "type": 3
          },
          "allDay": {
            "value": 0,
            "type": 1
          },
          "displayColor": {
            "value": -3312410,
            "type": 1
          },
          "rrule": {
            "value": "FREQ=WEEKLY;WKST=MO;BYDAY=MO",
            "type": 3
          },
          "event_id": {
            "value": 155,
            "type": 1
          },
          "hasAlarm": {
            "value": 0,
            "type": 1
          },
          "end": {
            "value": 1444060800000,
            "type": 1
          },
          "begin": {
            "value": 1444057200000,
            "type": 1
          }
        }
      ],
      "millisOffsetUtcToLocal": -25200000,
      "timeZoneId": "America\/Los_Angeles"
    }
  ],
  "applicationInfo": {
    "versionCode": 334,
    "preferences": {
      "showDaysWithoutEvents": false,
      "hideBasedOnKeywords": "",
      "eventRange": 7,
      "showPastEventsWithDefaultColor": false,
      "fillAllDay": true,
      "eventsEnded": "NONE"
    },
    "versionName": "1.9.2-6b6d980"
  },
  "resultsVersion": 1,
  "deviceInfo": {
    "buildManufacturer": "samsung",
    "versionCode": 19,
    "buildBrand": "samsung",
    "versionCodename": "REL",
    "buildModel": "SAMSUNG-SGH-I747",
    "versionRelease": "4.4.4"
  }
}
yvolk commented 9 years ago

Hello @Nikratio, I'm trying to reproduce your problem. I created new test case with a report, that your provided (see commit above...), and now I'm replaying your report at test environment. The only thing that needed to be set manually for the test was a Time Zone. I set "GMT-07:00 Pacific Daylight Time" in emulator. Now when I'm running the WrongDatesLostEventsTest I see the below list of Widget entries, which looks exactly as you need. The only difference: I'm running the code after today's fix of #206 (not sure if that could fix this issue also). Could you build current code of this repository and check?

10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 00 DayHeader [startDate=2015-10-01T00:00:00.000-07:00]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 01 CalendarEntry [startDate=2015-10-01T08:30:00.000-07:00, endDate=2015-10-01T16:30:00.000-07:00, allDay=false, event=CalendarEvent [eventId=172, title=Mathworks Advisory Board Meeting, startDate=2015-10-01T08:30:00.000-07:00, endDate=2015-10-01T16:30:00.000-07:00, color=-3312410, allDay=false, alarmActive=false, recurring=false, location=Manhattan Beach Marriott, 1400 Parkview Ave, Manhattan Beach, CA 90266, United States]]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 02 CalendarEntry [startDate=2015-10-01T12:00:00.000-07:00, endDate=2015-10-01T13:00:00.000-07:00, allDay=false, event=CalendarEvent [eventId=160, title=Company Meeting, startDate=2015-10-01T12:00:00.000-07:00, endDate=2015-10-01T13:00:00.000-07:00, color=-3312410, allDay=false, alarmActive=false, recurring=false, location=]]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 03 DayHeader [startDate=2015-10-03T00:00:00.000-07:00]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 04 CalendarEntry [startDate=2015-10-03T10:00:00.000-07:00, endDate=2015-10-03T12:00:00.000-07:00, allDay=false, event=CalendarEvent [eventId=1078, title=Maker Fair, startDate=2015-10-03T10:00:00.000-07:00, endDate=2015-10-03T12:00:00.000-07:00, color=-6644481, allDay=false, alarmActive=false, recurring=false, location=Balboa Park, San Diego, CA, USA]]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 05 DayHeader [startDate=2015-10-04T00:00:00.000-07:00]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 06 CalendarEntry [startDate=2015-10-04T00:00:00.000-07:00, endDate=2015-10-05T00:00:00.000-07:00, allDay=true, event=CalendarEvent [eventId=978, title=Henry Ribakovs's birthday, startDate=2015-10-04T00:00:00.000-07:00, endDate=2015-10-05T00:00:00.000-07:00, color=-7151168, allDay=true, alarmActive=false, recurring=false, location=]]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 07 CalendarEntry [startDate=2015-10-04T09:00:00.000-07:00, endDate=2015-10-04T13:00:00.000-07:00, allDay=false, event=CalendarEvent [eventId=1080, title=Ribakovs, startDate=2015-10-04T09:00:00.000-07:00, endDate=2015-10-04T13:00:00.000-07:00, color=-6644481, allDay=false, alarmActive=false, recurring=false, location=XXXed out]]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 08 DayHeader [startDate=2015-10-05T00:00:00.000-07:00]
10-03 06:59:23.370 6780-6795/com.plusonelabs.calendar V/WrongDatesLostEventsTest: 09 CalendarEntry [startDate=2015-10-05T08:00:00.000-07:00, endDate=2015-10-05T09:00:00.000-07:00, allDay=false, event=CalendarEvent [eventId=155, title=Mathworks Conference, startDate=2015-10-05T08:00:00.000-07:00, endDate=2015-10-05T09:00:00.000-07:00, color=-3312410, allDay=false, alarmActive=false, recurring=true, location=]]
Nikratio commented 9 years ago

Can you give more detailed instructions for building the code? I never built an Android app before.

However, there might be a second problem: if it does work with the new build, we don't know for sure that the problem has been fixed because some time later the problem went away (I may have restarted the phone in between). So it doesn't seem to happen every time.

yvolk commented 9 years ago

If you are not a developer, I'm not sure, if building from a source code is a good way for you. You better wait for a Beta release then (please opt in to the Open Beta Testing channel here). We are generally building a code using Android Studio. Building a code on Android device may be fun, so you can also try AIDE, see the instruction for similar app. GIT URL to clone: https://github.com/plusonelabs/calendar-widget.git

We received a report that a Widget randomly becomes empty. If your case is similar, you could also try manual refresh. Anyway, next time you will see similar problem, please start from making the same report as above and then try to figure out if manual refresh / device reboot / app reinstall helps.

yvolk commented 9 years ago

Now this test case is automatically replayed using correct DateTime and a Time Zone. All tests passed.