resolve icon indicating copy to clipboard operation
resolve copied to clipboard

Cannot use loadEvents with startTime and endTime

Open pavsenin opened this issue 3 years ago • 1 comments

To Reproduce Steps to reproduce the behavior:

Execute the following code in api-handler:

const eventFilter = { startTime: new Date('2021-09-16T09:00:00').getTime() / 1000, endTime: new Date('2021-11-20T09:30:00').getTime() / 1000, limit: 2000, eventsSizeLimit: Number.MAX_SAFE_INTEGER, eventTypes: [ UPLOAD_CREATED ] }; const result = await req.resolve.eventstoreAdapter.loadEvents(eventFilter); await res.json(result);

Expected behavior The list of events is returned.

pavsenin avatar Nov 23 '21 13:11 pavsenin

This was fixed in https://github.com/reimagined/resolve/pull/2142 and available since 0.33.4 However the current documentation is wrong at some places and lacks details. For example the right key is finishTime, not endTime. Also startTime and finishTime are in milliseconds, so no need to use division. Please note also that the cursor returned from loadEvents with timestamp filter is currently invalid and can't be used in consequent calls to loadEvents.

FreeSlave avatar Nov 29 '21 13:11 FreeSlave