Skip to content

fix: validate StickyIndex sequence owners - #426

Open
JoongWonSeo wants to merge 3 commits into
y-crdt:mainfrom
JoongWonSeo:codex/issue-422-sticky-index-owner
Open

JoongWonSeo wants to merge 3 commits into
y-crdt:mainfrom
JoongWonSeo:codex/issue-422-sticky-index-owner

Conversation

@JoongWonSeo

@JoongWonSeo JoongWonSeo commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • add StickyIndex.resolve(sequence) -> int | None with exact resolved Yrs branch validation for Text and Array
  • make sequence-backed get_index() reject sibling, deleted, detached, or unavailable owners instead of returning a foreign numeric offset
  • replace StickyIndex decode/resolution unwrap() and unsafe conversion paths with Python ValueError/None outcomes
  • support valid empty/end positions and reject out-of-range construction
  • preserve serialized formats and transaction-based get_index() compatibility

Coverage includes both associations, Text/Array and cross-kind mismatches, start/interior/end and empty positions, cross-replica and fresh-wrapper resolution, sibling/deleted/detached/unavailable owners, malformed input, and legacy behavior. It also locks in nested Map-owned end-sentinel behavior across binary decode and replica transfer, while distinguishing a relative index-zero anchor and retaining wrong-owner rejection.

Validation

  • cargo check --all-targets
  • cargo test --all-targets — 6 passed
  • Ruff check and format
  • mypy
  • Python suite with coverage — 289 passed, 4,568/4,568 statements
  • MkDocs build

Closes #422.

This branch has not been deployed

No deployments
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.

Expose StickyIndex resolved owner or validate the supplied Sequence

1 participant