Skip to content

fix(solid): rename and remove an instance's registrations in one edit - #497

Merged
ixuz merged 1 commit into
mainfrom
fix/type-index-one-edit
Nov 2, 2026
Merged

ixuz merged 1 commit into
mainfrom
fix/type-index-one-edit

Conversation

@ixuz

@ixuz ixuz commented Nov 1, 2026

Copy link
Copy Markdown
Member

What and why

Renaming or deleting an instance used to change its registrations in a type index one at a time. Each change was a setThing or removeThing on the whole dataset, and each of those copies the document along with the changes made so far. So when an index held many registrations of the instance, the work grew with the square of their number, and that happened for both indexes.

The registrations to retitle, trim or remove are now gathered first and then applied with one setThings call and one removeThings call. New growth tests (packages/solid/src/typeIndex.growth.test.ts) hold renameInstanceRegistrations and removeInstanceRegistrations to linear time. After this change only tests used removeThing, so both clients (packages/solid and packages/solid-memo-client) drop it, and its tests now use removeThings. docs/style.md and the growth-test list in docs/testing.md are updated to match.

What the app writes to a pod does not change. Only the number of edits it takes to get there does.

For reviewers: this branch, fix/draft-listing-index and fix/graph-address-bound all change the same line of docs/testing.md and conflict there. Please merge them one at a time and rebase the rest after each merge.

Refs: GHSA-ww22-r24g-g5h7

Checklist

  • One issue. This pull request addresses one issue, linked above. (a private security advisory rather than a public issue, so it says Refs:)
  • One step. This pull request does not finish its issue, so it says Refs:, not Closes:. Leave this unchecked otherwise.
  • Done, as AGENTS.md defines it: npm run check passes (lint, Markdown and spelling included), npm run lint:reuse too if a file was added, and npm run crosscheck too if ns/ or decks/ changed. (crosscheck n/a: neither ns/ nor decks/ changed)
  • Tests. New and changed code has its tests, and every package stays at 100% coverage (docs/testing.md).
  • Docs. The docs say what changed, and a new page in docs/ is listed in docs/docs.ttl. (no new page)
  • Languages. A new or changed message is in every locale: en, sv, ko, de, es and fr (packages/ui/src/i18n/). (n/a: no message changed)
  • Vocabulary and shapes. Any change to ns/ was agreed in an issue first; no published ns/shapes/*/vN.ttl or decks/*/vN.ttl was edited; generated files were regenerated, not edited. (n/a: ns/ and decks/ are unchanged)
  • Breaking? Nothing in the public API breaks, or a commit says so (! and a BREAKING CHANGE: footer). npm run check:breaking sees a line of api/ that goes, but not a feature removed, nor a reader that reads less than before.
  • Pod data. Any change to what the app writes to a pod comes with its migration (docs/migrations.md). (n/a: the same registrations are written, in one edit instead of many)
  • Policy. Any change to an external rule the code follows (SM-2, the plural rules, a specification) is cited. (n/a: no external rule changed)
  • Licenses. New content is MIT, or a deck states its own license; a new file has its SPDX header (npm run lint:reuse), or a new deck its line in REUSE.toml; third-party content is credited.
  • Architecture. Imports follow docs/boundaries.md and the layers of docs/architecture.md.
  • Run. I ran the app (npm run dev) and tried the change, and considered the user journeys.
  • Authorship. I read and understand every line of this pull request, and answer for it, whatever tools helped write it (CONTRIBUTING.md).
  • Commits. Each commit is one logical change, in Conventional Commits form (type(scope): subject, ! and a BREAKING CHANGE: footer if it breaks something), with an imperative subject and a body that explains why (CONTRIBUTING.md).

@ixuz ixuz added bug Something isn't working interop labels Nov 1, 2026
Renaming or deleting an instance changed its registrations in a type
index one at a time, each with a setThing or removeThing on the whole
dataset, which copies the document and its changes so far. An index
with many registrations of the instance took time that grows with
their square, for each of the two indexes.

The registrations to retitle, to trim and to remove are now gathered
first and applied with one setThings and one removeThings call. Growth
tests pin both to linear time. Nothing but tests used removeThing any
more, so both clients drop it, and its tests now use removeThings.

Refs: GHSA-ww22-r24g-g5h7
@ixuz
ixuz force-pushed the fix/type-index-one-edit branch from 5450d6a to 4d83d4f Compare November 2, 2026 10:24
@ixuz
ixuz enabled auto-merge November 2, 2026 10:25
@ixuz
ixuz added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 675c083 Nov 2, 2026
51 checks passed
@ixuz
ixuz deleted the fix/type-index-one-edit branch November 2, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working interop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant