Skip to content

Fix duplicate snipsync IDs shared with hello-world - #502

Open
lennessyy wants to merge 1 commit into
mainfrom
docs/fix-duplicate-snippet-ids
Open

Fix duplicate snipsync IDs shared with hello-world#502
lennessyy wants to merge 1 commit into
mainfrom
docs/fix-duplicate-snippet-ids

Conversation

@lennessyy

Copy link
Copy Markdown
Contributor

What

Renames four snipsync markers so typescript-hello-worker and typescript-hello-client are unique to hello-world/.

File Was Now
empty/src/worker.ts typescript-hello-worker typescript-empty-worker
empty/src/client.ts typescript-hello-client typescript-empty-client
sleep-for-days/src/worker.ts typescript-hello-worker typescript-sleep-for-days-worker
sleep-for-days/src/client.ts typescript-hello-client typescript-sleep-for-days-client

Comment-only change; no code is touched.

Why

empty/ and sleep-for-days/ look scaffolded from hello-world/ and kept its snippet IDs, so each of those two IDs was defined in three files. Snipsync resolves duplicates silently rather than erroring, so whichever file it happens to read last wins.

This is not hypothetical. A docs page referencing typescript-hello-worker for a "Create and run a Worker" section pulled in sleep-for-days/src/worker.ts instead of hello-world/src/worker.ts, giving the reader a source link to an unrelated sample.

typescript-hello-worker is the only one of these currently referenced by the docs, so this change has no effect on any other page.

Not fixed here

Three other duplicate IDs exist in this repo. Each is duplicated within a single sample directory, so the intended source is ambiguous and none is referenced by the docs today:

  • typescript-esm-clientfetch-esm/src/client-local.ts, fetch-esm/src/client-fetch.ts
  • typescript-message-passing-introductionmessage-passing/introduction/src/{client,worker}.ts
  • typescript-polling-infrequentpolling/infrequent/src/{workflows,client,worker}.ts

Happy to fold those in if you'd prefer one sweep.

The empty and sleep-for-days samples were scaffolded from hello-world
and kept its snippet IDs, so typescript-hello-worker and
typescript-hello-client were each defined in three files. Snipsync
resolves duplicates silently, so a doc referencing typescript-hello-worker
got sleep-for-days rather than hello-world.

Renames the copies so both IDs are unique to hello-world.
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.

2 participants