Matchstic / Xen-HTML

Unified and simplified HTML rendering
GNU General Public License v2.0
109 stars 16 forks source link

Calendar/reminder API fetch() returning empty array #343

Open futurGH opened 3 years ago

futurGH commented 3 years ago

Describe the bug

Calling fetch() on the calendar and reminder APIs returns an empty array. api.calendar.upcomingWeekEvents returns a correct array of calendar events, while the equivalent api.calendar.fetch() or api.calendar.observeData(data => data.fetch()) with an end timestamp of Date.now() + oneWeek returns nothing.

To Reproduce

api.calendar.observeData((calendarData) => {
  console.log(calendarData.upcomingWeekEvents); // Returns Array(2)
  const oneWeek = 7 * 24 * 60 * 60 * 1000;
  calendarData
    .fetch(Date.now(), Date.now() + oneWeek, calendarData.calendars)
    .then(console.log) // Returns []
});
api.calendar
    .fetch(Date.now(), Date.now() + oneWeek, api.calendar.calendars)
    .then(console.log) // Returns []

The same issue occurs with api.reminders, where:

api.reminders.observeData((reminderData) => {
  console.log(reminderData.pending); // Returns Array(1)
  const oneWeek = 7 * 24 * 60 * 60 * 1000;
  reminderData
    .fetch(Date.now(), Date.now() + oneWeek, false /* true was also tried */, reminderData.lists)
    .then(console.log) // Returns []
});
api.reminders
    .fetch(Date.now(), Date.now() + oneWeek, false, api.reminders.lists)
    .then(console.log) // Returns []

Expected behavior

____data.fetch() with the appropriate parameters should return an array equal to that of calendarData.upcomingWeekEvents or reminderData.pending.

System Info