Skip to content

fix: repair relation reads and pin TypeDB 3.10 test env #129

Merged
ds1sqe merged 5 commits into
masterfrom
bug-127
May 21, 2026
Merged

fix: repair relation reads and pin TypeDB 3.10 test env #129
ds1sqe merged 5 commits into
masterfrom
bug-127

Conversation

@ds1sqe
Copy link
Copy Markdown
Owner

@ds1sqe ds1sqe commented May 21, 2026

Summary

  • Bugfix of BUG: RoleRef leak on unset optional role #126: base commit 9c21f91 hydrates relation role-player
    references by IID.
  • Bugfix of BUG: fetch query requires all roles #127: this branch fixes relation fetch queries so optional roles
    do not hide relation instances when those roles have no players.
  • Driver/runtime update: this branch pins the TypeDB driver/runtime test
    environment used to reproduce and verify both relation-read fixes.

Bugfix of #126

Base commit 9c21f91 (fix: hydrate relation role-player references by IID)
normalizes omitted optional roles and lets nested relation role players hydrate
as partial IID-backed references.

That matters for this PR because #127 also works in the relation-read path, and
its regression coverage depends on relation hydration preserving missing
optional roles correctly.

Bugfix of #127

  • Exclude unconstrained Card(0, ...) roles from the primary relation match.
  • Fetch optional role players through TypeQL try blocks when present.
  • Keep optional roles required when filters, role expressions, or ordering
    explicitly reference that role.
  • Add a live regression test where manager.all() returns relations both with
    and without an optional role player.

Driver/Runtime Update

  • Add a pinned Docker-in-Docker integration runner for Python 3.13.5 and
    TypeDB Server 3.10.4.
  • Pin the Python driver line to typedb-driver==3.10.0.

Verification

  • uv run --extra dev ruff check --fix .
  • uv run --extra dev ruff format .
  • uv run --extra dev pyright type_bridge/
  • uv run --extra dev pyright tests/
  • uv run --extra dev pytest tests/unit/ -x
  • ./test-integration-dind.sh -v --tb=short
  • ./test-proxy-integration.sh -v --tb=short
  • cargo test --manifest-path type-bridge-core/Cargo.toml --all-targets

Focused #127 regression:

./test-integration-dind.sh \
  tests/integration/crud/relations/test_fetch.py::test_fetch_all_includes_relations_with_empty_optional_roles \
  -v --tb=short

Fixes: #126
Fixes: #127

ds1sqe added 4 commits May 21, 2026 00:59
Fix relation-as-role-player hydration when TypeDB fetch results include
only the nested relation IID/type metadata.

These relation references are now built as partial IID-backed instances
instead of going through normal constructor validation, which avoids
requiring the nested relation's own role players.

Also prevent omitted optional roles from retaining class-level `RoleRef`
defaults on relation instances.

Closes: #126
Add a Docker-in-Docker integration runner pinned to the TypeDB 3.10.4
test environment, make the integration wrappers install dev extras,
and repair the Rust proxy integration path so it runs against
the pinned TypeDB image.
Pin CI and release workflows to Python 3.13.5.

Align development documentation and integration references with TypeDB
Server 3.10.4.

Constrain the Python driver to typedb-driver 3.10.0, which is compatible
with the TypeDB 3.10.x protocol.
Exclude unconstrained optional relation roles from the primary
fetch match pattern so relations remain visible when those
roles have no players.

Fetch optional role players through TypeQL try blocks,
but require them normally when filters, role expressions,
or ordering reference that role.

Closes #127.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Collapse the guarded role-player match arm so Rust CI passes with clippy -D warnings.
@ds1sqe ds1sqe merged commit 8829898 into master May 21, 2026
22 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.

BUG: fetch query requires all roles BUG: RoleRef leak on unset optional role

1 participant