Skip to content

xrefs: identifier and filter as query parameters; a batch's work bounded - #571

Merged
adamjohnwright merged 2 commits into
mainfrom
fix/xrefs-query
Oct 20, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
fix/xrefs-query

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Spec 006 (specs/006-content-service-to-node). From the review of everything merged since #485.

Query parameters. /references/mapping/{identifier}/xrefs and POST /references/mapping/xrefs wrote the identifier and dbFilter into the Cypher text, as ReferenceEntityController does. Both are now query parameters. For any identifier or filter without a double quote, the query and its answer are Java's. One with a quote is looked up as written and matches nothing (404, or NO MATCH in a batch). Java answers those with a 500, or with whatever the text has become. This is a deliberate difference from Java, limited to those inputs.

The batch endpoint's work is bounded:

  • it is a deep query, with its own share of the pool: each identifier is a scan of every node, and a 10 MB body holds millions;
  • a lookup that throws stops the rest, as one answering an error already did; before, the other workers ran on after the response;
  • no lookup starts once the client has gone.

Timeouts. A query the database ends at its time limit is the service's 503 here, as everywhere else, not Java's 500 with Neo4j's message.

Checks

  • Each new spec was shown failing without its fix: 9 on main's code, and one each with the throw and client-gone stops removed.
  • Tools unit tests: 1,130 passed. implicit-any 814 → 812; lint, loose and dead code unchanged.
  • On beta, rebuilt: the sample's xrefs with no filter, ENSEMBL, ZINC - World Drugs, a filter matching nothing, an unknown identifier, /references/mapping/P36897, and a batch POST were all identical before and after, timestamps masked. A quoted identifier is now a 404.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits October 20, 2026 18:14
/references/mapping/{identifier}/xrefs and POST /references/mapping/xrefs
wrote the identifier and dbFilter into the Cypher text between double
quotes, as ReferenceEntityController does. Both are now parameters. For
every identifier and filter without a quote the query and its answer are
Java's; one with a quote is looked up as written and matches nothing,
where Java answers 500 or runs the query the text has become.

The batch endpoint's work is bounded:
- it is a deep query (its own share of the pool): each identifier is a
  scan of every node, and a 10MB body holds millions;
- a lookup that throws abandons the rest, as one that answers an error
  already did -- before, the other workers ran on after the answer;
- no lookup starts once the client has gone.

A query the database ends (its time limit) is the service's 503 here too,
not Java's 500 with Neo4j's message.

Each new spec shown failing without its fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST /references/mapping/xrefs is no longer a deep route: it shared
  the four deep places with in-depth and locationsInPWB, which the
  Pathway Browser reads, so a script paging through batches could have
  turned those into 503s. Batches have a share of their own, two at a
  time, taken after the request's own checks (so a malformed one is
  still Java's 415/400/413/422).
- The claim says what is exactly true: an identifier or filter with
  neither a quote nor a backslash gets Java's query and answer (a
  backslash begins an escape in Java's text).
- The quote spec uses a bare quote; it proves the same thing.
- The client-gone spec waits for the first lookup and asserts there was
  one, so it cannot pass by testing nothing.

Each new spec shown failing without its fix. Beta: the xrefs captures
identical again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 609ee03 into main Oct 20, 2026
7 checks passed
@adamjohnwright
adamjohnwright deleted the fix/xrefs-query branch October 20, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant