Skip to content

fix: mutation input safety and custom ID support in SparqlStore#40

Merged
flyon merged 6 commits intomainfrom
dev
Mar 27, 2026
Merged

fix: mutation input safety and custom ID support in SparqlStore#40
flyon merged 6 commits intomainfrom
dev

Conversation

@flyon
Copy link
Member

@flyon flyon commented Mar 27, 2026

Summary

  • MutationQuery.convertNodeDescription() now shallow-copies input before deleting id/__id, preventing shared object corruption across sequential creates
  • SparqlStore.createQuery() respects pre-set data.id from __id instead of always generating a new URI
  • Jest config fix: prevents duplicate test file discovery
  • Fuseki tests auto-start Docker via ensureFuseki() and no longer delete the shared dataset in afterAll
  • Regression tests for both bugs (unit + Fuseki integration)

Test plan

  • All 999 tests pass (npx jest --no-coverage)
  • 83 Fuseki integration tests pass including 2 new regression tests
  • 28 mutation-builder tests pass including 3 new input non-mutation tests
  • PeaceGame signup flow works end-to-end (user + account creation, JWT token, redirect)

🤖 Generated with Claude Code

github-actions bot and others added 6 commits March 25, 2026 03:40
…tom __id in SparqlStore

MutationQuery.convertNodeDescription() was mutating the caller's input object
via `delete obj.id`/`delete obj.__id`. When an object was reused across
sequential creates (e.g. auth creating a user then referencing it in an
account), the shared object lost its id — breaking downstream code like JWT
token creation.

SparqlStore.createQuery() always generated a new URI via generateEntityUri,
overwriting any custom id set by __id. Entities created with webID-based
identity were stored under random URIs instead.

Also: fix jest config to prevent duplicate test runs, use ensureFuseki() for
auto-starting Docker in integration tests, and stop deleting the shared test
dataset in afterAll to prevent parallel test interference.

Adds regression tests for both bugs (unit + Fuseki integration).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@flyon flyon merged commit 15cc969 into main Mar 27, 2026
7 checks passed
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