`src/lib/client/yjs-client.ts`'s `resolveCollectionDoc` (used by `RelationPropertyCell.svelte` to connect to a relation field's target Collection) resolves its shard lookup with no validation — no `res.ok` check, no check that `shardId` is a non-empty string — before caching it (memoized per `collectionId` for the tab's lifetime) and connecting via `getShardDoc`.
A non-2xx or malformed response therefore creates and caches a `Y.Doc` for an invalid shard, and because the result is memoized, the bad connection sticks for the tab's lifetime instead of retrying.
PR #200 fixed the identical gap in `useCollectionConnection` (the shared hook every Collection renderer uses for its own Collection) per CodeRabbit's review; this is the same bug class in `resolveCollectionDoc`'s cross-Collection lookup, left out of that PR's scope.
Done when: `resolveCollectionDoc` rejects and evicts its cache on a non-ok or malformed shard-lookup response, consistent with `useCollectionConnection`'s validation.
`src/lib/client/yjs-client.ts`'s `resolveCollectionDoc` (used by `RelationPropertyCell.svelte` to connect to a relation field's target Collection) resolves its shard lookup with no validation — no `res.ok` check, no check that `shardId` is a non-empty string — before caching it (memoized per `collectionId` for the tab's lifetime) and connecting via `getShardDoc`.
A non-2xx or malformed response therefore creates and caches a `Y.Doc` for an invalid shard, and because the result is memoized, the bad connection sticks for the tab's lifetime instead of retrying.
PR #200 fixed the identical gap in `useCollectionConnection` (the shared hook every Collection renderer uses for its own Collection) per CodeRabbit's review; this is the same bug class in `resolveCollectionDoc`'s cross-Collection lookup, left out of that PR's scope.
Done when: `resolveCollectionDoc` rejects and evicts its cache on a non-ok or malformed shard-lookup response, consistent with `useCollectionConnection`'s validation.