Bug #13574

OAI-PMH resumptionToken forgets from & until arguments

Added by David Juhasz about 1 month ago. Updated about 1 month ago.

Status:VerifiedStart date:10/08/2021
Priority:MediumDue date:
Assignee:-% Done:

100%

Category:OAI-PMH
Target version:Release 2.7.0
Google Code Legacy ID: Tested version:2.7
Sponsored:No Requires documentation:No

Description

An OAI-PMH "ListIdentifiers" request with a "resumptionToken" argument includes records with a datestamp before the "from" argument and/or after the "until" argument specified in the initial "ListIdentifiers" request, which prevents retrieving a complete list of records for the initial request criteria.

Context
OAI-PMH v2.0 specification defines the resumptionToken argument as "an exclusive argument" where an exclusive argument is defined as "the argument may be included with request, but must be the only argument (in addition to the verb argument)." With the stated restrictions on resumptionToken usage, effectively retrieving a complete set of results requires that the resumptionToken argument preserve the initial query criteria, including "from", "until", and "metadataPrefix" arguments for the "ListIdentifiers" and "ListRecords" verbs.

To reproduce
  1. Enable the OAI-PMH plugin
  2. Make an OAI-PMH "ListIdentifiers" request with a "from" or "until" argument that returns an incomplete list and includes a resumptionToken (e.g. http://localhost/;oai?verb=ListIdentifiers&from=2012-09-21&metadataPrefix=oai_dc)
  3. Make a subsequent "ListIdentifiers" request using the "resumptionToken" argument (e.g.
    http://localhost/;oai?verb=ListIdentifiers&resumptionToken=eyJmcm9tIjoxMzQ4MjEwODAwLCJ1bnRpbCI6IiIsImN1cnNvciI6MTAwLCJtZXRhZGF0YVByZWZpeCI6Im9haV9kYyIsInNldCI6IiJ9)

Resulting error
The response may include records with a datestamp outside the range specified by the initial "from" and "until" arguments.

Expected result
The response should only include records with a datestamp in the range specified by the initial "from" and "until" arguments.


Related issues

Related to Access to Memory (AtoM) - Bug #13025: OAI requests do not convert local date/time information i... Feedback 05/14/2019

History

#1 Updated by David Juhasz about 1 month ago

This is true of the "ListRecords" resumptionToken argument as well.

It looks like this may be a problem with converting the from parameter to a Unix timestamp.

For instance, an initial ListRecords request response includes:

<request verb="ListRecords" from="2012-09-21" metadataPrefix="oai_dc">http://localhost:63001/;oai</request>

But the resumptionToken response includes:

<request verb="ListRecords" resumptionToken="eyJmcm9tIjoxMzQ4MjEwODAwLCJ1bnRpbCI6IiIsImN1cnNvciI6MTAsIm1ldGFkYXRhUHJlZml4Ijoib2FpX2RjIiwic2V0IjoiIn0=" from="1348210800" cursor="10" metadataPrefix="oai_dc">http://localhost:63001/;oai</request>

Note that in the first response the "from" argument is "2012-09-21" (ISO 8601 compliant) but the second response value is "1348210800" (the Unix epoch representation of Fri Sep 21 07:00:00 2012 UTC).

#2 Updated by David Juhasz about 1 month ago

  • Related to Bug #13025: OAI requests do not convert local date/time information into UTC, leading to unexpected results added

#3 Updated by David Juhasz about 1 month ago

  • Status changed from New to Code Review

I've opened https://github.com/artefactual/atom/pull/1449 with a fix for this bug.

#4 Updated by David Juhasz about 1 month ago

  • Status changed from Code Review to QA/Review
  • Assignee deleted (David Juhasz)

#5 Updated by Dan Gillean about 1 month ago

  • Status changed from QA/Review to Verified
  • % Done changed from 0 to 100
  • Requires documentation set to No

Also available in: Atom PDF