Xen-HTML icon indicating copy to clipboard operation
Xen-HTML copied to clipboard

Calendar/reminder API fetch() returning empty array

Open futurGH opened this issue 4 years ago • 0 comments

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

  • Device: iPad 7,6 (6th generation)
  • OS: iPadOS 14.2
  • Xen HTML version: 2.0~release

futurGH avatar Jul 31 '21 15:07 futurGH