fix(snipsync): drop duplicate origins and all non-main refs - #5022
Merged
Conversation
Snipsync has failed intermittently since 2026-07-20 and on every run since
2026-07-30. Two independent causes.
Duplicate origins. features and reference-app-orders-go were each listed
twice. Sync.js names every download `${repo}.zip` from the repo alone and
fans all origins out through one Promise.all, and unzip() unlinks the
archive when it finishes. Two tasks sharing a filename race: one reads a
partially written or already deleted archive and yauzl throws
Error: unexpected EOF
at node_modules/yauzl/index.js:629:23
from an fs callback, which escapes getRepos()'s try/catch and kills the
process. Hence the intermittency, and hence no "Failed downloading" line
in the logs. The duplicates date to #3932 and #4247.
Dead branch pin. #4663 pinned samples-dotnet to ea/aws-lambda on 07-30.
That sample merged to main in temporalio/samples-dotnet#152 and the branch
was deleted, so every run since has 404'd on the archive download and
burned five retries. Unpinning is safe for the docs page: snipsync only
splices IDs it finds in a source, and leaves unmatched markers untouched,
so the .NET lambda page keeps its current content.
samples-java stays pinned. temporalio/samples-java#784 is still open and
lambda-worker/ exists only on that branch. The pin is collateral-free
today: the branch's only divergence from main outside lambda-worker/ is
.github/workflows/ci.yml, which carries no snippet markers.
Verified by running yarn snipsync locally against this config: completes
in 87s with no crash, 711/716 target files unchanged, and both lambda
pages untouched.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview linksThis PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here. |
Duncanma
approved these changes
Aug 3, 2026
Removes the remaining non-main ref. samples-server keeps ref: main, which is already main. temporalio/samples-java#784 has not merged, so lambda-worker/ exists only on ea/aws-lambda. The java lambda page's three snippets therefore have no source on main and stop tracking upstream. They keep their current content: snipsync only splices IDs it finds in a source and leaves unmatched markers alone. Confirmed by running yarn snipsync against this config, which leaves both lambda pages untouched and reports 712/716 files unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Snipsync has been failing intermittently since 2026-07-20 and on every run since 2026-07-30, so no snippet has synced in five days. Two independent causes.
1. Duplicate origins race the same zip filename
featuresandreference-app-orders-gowere each listed twice.Sync.js:277names every download`${repo}.zip`— from the repo alone, no owner or ref — andgetReposfans all origins out through a singlePromise.all.unzip()then unlinks the archive when it finishes (Sync.js:297). Two tasks sharing a filename race, and the loser reads a partially written or already deleted archive:That throw originates in an fs callback, so it escapes
getRepos's try/catch and hard-kills the process — which is why the logs never show the handler's ownFailed downloading ...message. Being a race, it explains the intermittency. The duplicates are old:reference-app-orders-gosince #3932 (Nov 2025),featuressince #4247 (Mar 2026).2. Branch pins, one of them dead
#4663 pinned both
samples-dotnetandsamples-javatoea/aws-lambdaon 07-30.samples-dotnet's branch no longer exists — that sample merged in temporalio/samples-dotnet#152 (07-21) and the branch was deleted — so every run since has 404'd on the archive download and burned five retries. That's theOperation failed - Retrying in 1000 ms...line.Separating the two causes: the 07-20 and 07-27 failures show
unexpected EOFwith no retry line, i.e. the race alone, before the pin existed. 08-03 shows both. The pin is why occasional failures became five in a row.This PR removes every non-main
ref.samples-serverkeepsref: main, which is already main.Known consequence for the Java lambda page
temporalio/samples-java#784 has not merged, so
lambda-worker/exists only onea/aws-lambda. Unpinning means the java lambda page's three snippets (java-lambda-worker,java-lambda-worker-workflow,java-lambda-worker-otel-collector-config) have no source on main and stop tracking upstream.They keep their current content rather than breaking: snipsync only splices IDs it finds in a source, and leaves unmatched markers untouched. Re-pin or merge #784 when the snippets need to move again.
The tradeoff being made deliberately: a
ref:pins every snippet from that repo, not one page's, so carrying a feature-branch pin in shared config to serve a single page is the more expensive side.Testing
Ran
yarn snipsynclocally against the final config:712/716 target file(s) unchanged.golang:1.24.1→golang:1.25.4indocs/best-practices/worker.mdx. Discarded to keep this PR config-only; the next scheduled run picks them up.Follow-ups, not in this PR
mainwithout snipsync markers —samples-dotnet@mainhas zeroSNIPSTARTmarkers anywhere, so the page's three IDs resolve nowhere on any ref. Content is correct today but frozen until markers are added upstream.${repo}.zipshould include owner and ref so this class of collision is impossible. Belongs upstream in snipsync.docs/develop/java/best-practices/testing-suite.mdx— fourjava-nexus-*-mocksnippets warnmismatched end marker ... Skipping spliceand are silently not syncing. Unrelated to this failure, and invisible because the warning scrolls past in an exit-0 run.🤖 Generated with Claude Code