Skip to main content

Fetching & Paginating most recent data

Fetching most recent data with pagination

Achieved by simulating a traditional request-response flow via an ad-hoc subscription to any specific relay and injecting into the desired filters JSON/s the following:

  • "limit":N, where N > 0
  • "until":${oldest_relevant_event.created_at - 1 second}, where oldest_relevant_event is the type of event targeted by the filter
    • -1 second because otherwise events might be unintentionally skipped between pages due to the poor precision of the timestamps (seconds rather than milliseconds)
    • for the first page, this until field is not set