René's URL Explorer Experiment


Title: fix(forks): stop copying connector-managed knowledge base documents by icecrasher321 · Pull Request #6818 · simstudioai/sim · GitHub

Open Graph Title: fix(forks): stop copying connector-managed knowledge base documents by icecrasher321 · Pull Request #6818 · simstudioai/sim

X Title: fix(forks): stop copying connector-managed knowledge base documents by icecrasher321 · Pull Request #6818 · simstudioai/sim

Description: Summary A fork copies a knowledge base's documents but never its connectors — deliberate, per copyForkResourceContainers ("the child is a content snapshot without live sync"). What was not deliberate is that connector-sourced documents were copied anyway, arriving with connector_id nulled and external_id, content_hash, source_url and the original uploaded_at intact. That copy is unreachable by the sync engine, which scopes every existing / tombstone / exclusion lookup to eq(document.connectorId, connectorId) (sync-engine.ts:828-885). It can never be updated, reconciled, or purged. doc_connector_external_id_idx — UNIQUE (connector_id, external_id) WHERE deleted_at IS NULL — does not constrain it either, because Postgres treats NULLs as distinct. So attaching a connector in the child re-ingests every page as a new row on top of the snapshot. And since the copy loop filtered only deleted_at / archived_at, each hop also re-copied the previous hop's orphans: inherited (fork_document_*) connector (UUID) total prod 0 56 56 UAT (fork + attach connector) 56 56 112 staging (fork + attach connector) 112 56 168 Three rows per page, so a knowledge search returns the same page three times — one of them frozen at the fork date, serving content nothing will ever refresh. This was reported from a real prod → UAT → staging chain: 191 documents for ~56 Confluence pages. The change Exclude connector-managed documents at all four doors a document can enter a fork through: Site Change copyForkResourceContent whole-KB page query isNull(document.connectorId) createForkDocumentPlaceholders (in the fork tx) isNull(document.connectorId) planForkMappedKbDocumentCopies (sync-only, doc → already-mapped KB) isNull(document.connectorId) contentPlan.documents fill loop explicit source.connectorId guard The placeholder path matters as much as the copy loop. Filtering only the content phase would leave a referenced connector document with an archived placeholder and a persisted knowledge_document mapping pointing at it, with nothing behind it to ever fill it. Skipped on both sides, its document-selector reference clears like any other uncopied document's — existing, documented behavior. The fourth guard covers one case only: a payload planned by a pre-change worker and filled by a new one mid-rollout. It throws into the existing per-document cleanup, which drops the placeholder and clears its references — the same outcome the new planner produces. A document whose connector was deleted in the source already has a null connector_id (the FK is ON DELETE SET NULL) and is static content there too, so it still copies. That falls out of the predicate rather than needing a special case. One count(*) per copied KB logs what was left behind — a fully connector-synced KB now forks to zero documents, and without this there would be nothing anywhere explaining why. Docs New #### Connector-synced documents are not copied under "Knowledge bases and documents": the sharp edge in a warn callout, the reasoning, and the two workarounds (re-add the connector for live content; download-and-upload for a frozen snapshot). The at-a-glance row links to it. Also corrected the adjacent line, which claimed "Documents that the forked workflows actually reference are included" — the fork copies every document in the KB; only the placeholder pre-creation was ever reference-scoped. Not in scope This stops new duplication; it does not clean up KBs already in this state. No follow-up is needed — the known-affected knowledge bases have already been corrected manually, out of band. No backfill or migration ships with this PR. Type of Change Bug fix Testing bun run test ee/workspace-forking → 39 files, 601 tests passed. type-check, biome check and check:api-validation all clean. Four new tests. The predicates are the whole fix, and the row-queue mocks return whatever is enqueued regardless of the where, so three of them assert the condition tree via flattenMockConditions + schemaMock — the helper that exists for exactly this: whole-KB page query excludes connector_id placeholder pre-creation excludes it, and records no knowledge_document mapping mapped-KB candidate query excludes it U-docs fill refuses a connector-managed source: charges nothing, downloads nothing, reports a knowledge-document failure for cleanup Also flipped the planForkMappedKbDocumentCopies fixture from connectorId: 'connector-1' to null — it was describing a document the planner must now never place. Reviewers should focus on the placeholder/content-phase agreement (they must skip the same set or a mapping dangles) and on whether losing connector content at fork time is the right trade for the affected teams — a fully-synced KB now forks empty, which is a real behavior change the docs callout is there to set expectations for. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary A fork copies a knowledge base's documents but never its connectors — deliberate, per copyForkResourceContainers ("the child is a content snapshot without live sync"). What wa...

X Description: Summary A fork copies a knowledge base's documents but never its connectors — deliberate, per copyForkResourceContainers ("the child is a content snapshot without live sync&quo...

Opengraph URL: https://github.com/simstudioai/sim/pull/6818

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9ed9adf2-4178-9775-3bec-8457ec76ed25
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC892:277BD5:E442CD:138A78E:6AFB5DE6
html-safe-noncedd356ff1ee1e4e4c8773e63db1ffe78382ae945198a14d9193e62d60f46cad6e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODkyOjI3N0JENTpFNDQyQ0Q6MTM4QTc4RTo2QUZCNURFNiIsInZpc2l0b3JfaWQiOiI1MTg3NDI2Mzg2MjUxMDQ2Mzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9b29b1813305e015f1a692bff4efbfe0af71cdb6cce2390d0f84c5faed9574d2
hovercard-subject-tagpull_request:4308308667
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6818/files
twitter:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
og:image:altSummary A fork copies a knowledge base's documents but never its connectors — deliberate, per copyForkResourceContainers ("the child is a content snapshot without live sync"). What wa...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6818/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6818%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6818%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6818/files
Reloadhttps://github.com/simstudioai/sim/pull/6818/files
Reloadhttps://github.com/simstudioai/sim/pull/6818/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
icecrasher321https://github.com/icecrasher321
staginghttps://github.com/simstudioai/sim/tree/staging
fix/fork-skip-connector-managed-documentshttps://github.com/simstudioai/sim/tree/fix/fork-skip-connector-managed-documents
Conversation 22 https://github.com/simstudioai/sim/pull/6818
Commits 4 https://github.com/simstudioai/sim/pull/6818/commits
Checks 31 https://github.com/simstudioai/sim/pull/6818/checks
Files changed https://github.com/simstudioai/sim/pull/6818/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6818/files
fix(forks): stop copying connector-managed knowledge base documents https://github.com/simstudioai/sim/pull/6818/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/6818/files
b25816f fix(forks): stop copying connector-managed knowledge base documents Aug 18, 2026 https://github.com/simstudioai/sim/pull/6818/commits/b25816fde9861bba599947a7d95831091570c71d
acfd00a fix(forks): keep the skipped-document count from failing a copied KB Aug 18, 2026 https://github.com/simstudioai/sim/pull/6818/commits/acfd00ab6fa3e64a5d52a89627efafcb08d1edeb
5d7749b fix(forks): clean up full-KB placeholders planned before the exclusion Aug 18, 2026 https://github.com/simstudioai/sim/pull/6818/commits/5d7749b197d78390b2ea83f1971bec5e2db41ab2
ae315cc fix(forks): make the stale-plan probe best-effort Aug 18, 2026 https://github.com/simstudioai/sim/pull/6818/commits/ae315cc4c81a53d0127676ad434963d9168b8943
Clear filters https://github.com/simstudioai/sim/pull/6818/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6818/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6818/files
forks.mdx https://github.com/simstudioai/sim/pull/6818/files#diff-18cdfc3bd61e078159705de0d8e23120d44dda9621453e9cb64970eb1518dc1c
copy-resources.test.ts https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
copy-resources.ts https://github.com/simstudioai/sim/pull/6818/files#diff-8090f65dbd57000145cea8bb14673ad7008ab9c9bf550c267d736e4abf3c7ffb
apps/docs/content/docs/en/platform/enterprise/forks.mdxhttps://github.com/simstudioai/sim/pull/6818/files#diff-18cdfc3bd61e078159705de0d8e23120d44dda9621453e9cb64970eb1518dc1c
View file https://github.com/simstudioai/sim/blob/ae315cc4c81a53d0127676ad434963d9168b8943/apps/docs/content/docs/en/platform/enterprise/forks.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6818/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6818/files#diff-18cdfc3bd61e078159705de0d8e23120d44dda9621453e9cb64970eb1518dc1c
https://github.com/simstudioai/sim/pull/6818/files#diff-18cdfc3bd61e078159705de0d8e23120d44dda9621453e9cb64970eb1518dc1c
https://github.com/simstudioai/sim/pull/6818/files#diff-18cdfc3bd61e078159705de0d8e23120d44dda9621453e9cb64970eb1518dc1c
https://github.com/simstudioai/sim/pull/6818/files#diff-18cdfc3bd61e078159705de0d8e23120d44dda9621453e9cb64970eb1518dc1c
apps/sim/ee/workspace-forking/lib/copy/copy-resources.test.tshttps://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
View file https://github.com/simstudioai/sim/blob/ae315cc4c81a53d0127676ad434963d9168b8943/apps/sim/ee/workspace-forking/lib/copy/copy-resources.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6818/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
https://github.com/simstudioai/sim/pull/6818/files#diff-963c6ff31e66e98956f6635d910841a48e456cf551f33319f6f1dfc6e9789287
Please reload this pagehttps://github.com/simstudioai/sim/pull/6818/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6818/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.