Skip to content

fix(epcis): expose queryable identifiers for captured events - #2492

Open
branarakic wants to merge 12 commits into
testnet-canaryfrom
fix/issue-708-epcis-event-identifiers
Open

fix(epcis): expose queryable identifiers for captured events#2492
branarakic wants to merge 12 commits into
testnet-canaryfrom
fix/issue-708-epcis-event-identifiers

Conversation

@branarakic

@branarakic branarakic commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Return the stored event subject as a required eventID on every EPCIS query result, so callers can reuse it unchanged in the eventID filter. This covers caller-assigned and historical canonical DKG roots; it cannot reconstruct identifiers lost before storage.

The legacy toEpcisEvent helper accepts sparse generic rows and reconstructs available EPCIS fields without adding identity. A separate query decoder validates the subject as a safe absolute IRI and adds the required response eventID. Missing, blank-node, relative and unsafe query identities retain the 502 error contract. Shared field types preserve precise timestamps, locations, EPC arrays and provenance. Both converter and query-response contracts retain an open unknown index signature for existing dynamic-field inspection; only the validated query response promises a string identity. Capture still requires its type and timestamp.

Validation: 185 offline EPCIS tests and coverage ratchets pass; 86 existing opt-in API E2E cases remain skipped. The sparse converter now explicitly tests valid URN and HTTPS identities as well as unusable ones, always omitting eventID. Query tests separately require reusable identity, including real-store round trips across visibility, finalization and subgraph paths. Package consumer types prove dynamic indexing still compiles while known fields remain precise and raw identity needs validation. EPCIS build/public types, repository lint, inventory and SPARQL checks pass. Earlier revisions additionally passed the CLI build.

Closes #708.

Comment thread packages/epcis/src/handlers.ts Outdated
Comment thread packages/epcis/test/events-query.test.ts Outdated
@branarakic
branarakic requested a review from Jurij89 as a code owner September 7, 2026 17:41
Comment thread packages/epcis/src/handlers.ts Outdated
Comment thread packages/epcis/src/handlers.ts Outdated
Comment thread packages/epcis/src/types.ts Outdated
Comment thread packages/epcis/src/query-event-fields.ts Outdated
Comment thread packages/epcis/src/handlers.ts Outdated
Comment thread packages/epcis/src/types.ts Outdated
Comment thread packages/epcis/test/events-query.test.ts
Comment thread packages/epcis/test/events-query.test.ts Outdated

@otReviewAgent otReviewAgent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Agent completed this review and found no issues.

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.

3 participants