Switched from <= to < in members event pagination

refs https://github.com/TryGhost/Team/issues/1277

- using `<= created_at` requires client-side deduplication to prevent the same records appearing in the next page
- using `< created_at` does result in a possibility of records being missed between pages with the API's current pagination behaviour if many events occur within the same second but for our current requirements (no email events shown unless filtering by specific member) that is edge-case enough that simplified client code is preferable
This commit is contained in:
Kevin Ansfield 2022-01-24 11:01:32 +00:00
parent 9c139a78e4
commit 9c06b5e71f

View File

@ -31,7 +31,7 @@ export default class MembersEventsFetcher extends Resource {
async setup() {
this.cursor = moment.utc().format('YYYY-MM-DD HH:mm:ss');
let filter = `created_at:<='${this.cursor}'`;
let filter = `created_at:<'${this.cursor}'`;
if (this.args.named.filter) {
filter += `+${this.args.named.filter}`;
@ -58,7 +58,7 @@ export default class MembersEventsFetcher extends Resource {
}
this.cursor = cursor;
let filter = `created_at:<='${this.cursor}'`;
let filter = `created_at:<'${this.cursor}'`;
if (this.args.named.filter) {
filter += `+${this.args.named.filter}`;