René's URL Explorer Experiment


Title: project.append_asset: TypeError aborts entire append when a library type's GlobalId collides with a different-class element in the destination · Issue #8667 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: project.append_asset: TypeError aborts entire append when a library type's GlobalId collides with a different-class element in the destination · Issue #8667 · IfcOpenShell/IfcOpenShell

X Title: project.append_asset: TypeError aborts entire append when a library type's GlobalId collides with a different-class element in the destination · Issue #8667 · IfcOpenShell/IfcOpenShell

Description: Describe the bug When project.append_asset appends a product whose type's GlobalId collides with an element of a different class already present in the destination file, the entire append aborts with: File ".../ifcopenshell/api/project/a...

Open Graph Description: Describe the bug When project.append_asset appends a product whose type's GlobalId collides with an element of a different class already present in the destination file, the entire append aborts wi...

X Description: Describe the bug When project.append_asset appends a product whose type's GlobalId collides with an element of a different class already present in the destination file, the entire append abort...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/8667

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"project.append_asset: TypeError aborts entire append when a library type's GlobalId collides with a different-class element in the destination","articleBody":"### Describe the bug\n\nWhen `project.append_asset` appends a product whose **type**'s `GlobalId` collides with an element of a *different class* already present in the destination file, the entire append aborts with:\n\n```\n  File \".../ifcopenshell/api/project/append_asset.py\", line 449, in append_product\n    ifcopenshell.api.type.assign_type(\n  File \".../ifcopenshell/api/type/assign_type.py\", line 213, in execute\n    raise TypeError(\nTypeError: IfcFlowTerminal cannot type IfcSanitaryTerminal in schema IFC4 (allowed occurrence classes: \u003cnone>)\n```\n\nThis only happens when appending into an existing (populated) file, never into a blank one.\n\n### Root cause\n\n`Usecase.get_existing_element` reuses any `IfcRoot` purely by `GlobalId`, regardless of class:\n\n```python\nif element.is_a(\"IfcRoot\"):\n    return self.by_guid(element.GlobalId)\n```\n\nIn `append_product`, the occurrence's type is appended recursively and the resulting entity passed to `assign_type`. If the library type's `GlobalId` already exists in the destination on an unrelated element (e.g. an `IfcFlowTerminal` occurrence), `get_existing_element` returns that occurrence as the \"type\". `assign_type` then correctly rejects an occurrence-classed entity as a `RelatingType`, raising `TypeError` — which aborts the whole batch append and leaves the model partially modified.\n\n### Minimal reproduction\n\n```python\nimport ifcopenshell\nimport ifcopenshell.api.root, ifcopenshell.api.context\nimport ifcopenshell.api.project, ifcopenshell.api.unit, ifcopenshell.api.type\n\ndef new_file(name):\n    f = ifcopenshell.file(schema=\"IFC4\")\n    ifcopenshell.api.root.create_entity(f, ifc_class=\"IfcProject\", name=name)\n    unit = ifcopenshell.api.unit.add_si_unit(f, unit_type=\"LENGTHUNIT\")\n    ifcopenshell.api.unit.assign_unit(f, units=[unit])\n    ifcopenshell.api.context.add_context(f, context_type=\"Model\")\n    return f\n\nlibrary = new_file(\"Lib\")\nocc = ifcopenshell.api.root.create_entity(library, ifc_class=\"IfcSanitaryTerminal\")\ntyp = ifcopenshell.api.root.create_entity(library, ifc_class=\"IfcSanitaryTerminalType\")\nifcopenshell.api.type.assign_type(library, related_objects=[occ], relating_type=typ)\n\nproject = new_file(\"Dest\")\n# destination already contains an unrelated element sharing the library type's GlobalId\nft = ifcopenshell.api.root.create_entity(project, ifc_class=\"IfcFlowTerminal\")\nft.GlobalId = typ.GlobalId\n\nifcopenshell.api.project.append_asset(project, library=library, element=occ)\n# -> TypeError: IfcFlowTerminal cannot type IfcSanitaryTerminal in schema IFC4 (allowed occurrence classes: \u003cnone>)\n```\n\n### Suggested fixes (either or both)\n\n1. In `get_existing_element`, only reuse a by-`GlobalId` match when the class is compatible (`existing.is_a(element.is_a())`). A cross-class GUID match is a collision and should not be treated as the same asset.\n2. In `append_product`, guard the `assign_type` call so a single colliding/malformed asset does not abort the whole batch — append the occurrence untyped and emit a warning instead of raising.\n\n### Impact\n\nA single duplicated `GlobalId` anywhere across a large library/destination pair aborts the *entire* multi-asset append, leaving a partially-modified model. This is realistic with Revit-exported IFC content where GlobalIds are sometimes reused across entities.\n\n### Environment\n\n- ifcopenshell (bundled with Bonsai on Blender 4.5), schema IFC4, `v0.8.0` branch.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-07-17T02:39:43Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8667"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e0d1a3fa-17fc-814a-02ea-29badffb5038
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD838:281ABB:A81B4A:E56A1D:6B048340
html-safe-noncee95ba2890266d9bf6dac1a1ab2720d8716c5e5aefb1cef7b9c82d037d9552516
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODM4OjI4MUFCQjpBODFCNEE6RTU2QTFEOjZCMDQ4MzQwIiwidmlzaXRvcl9pZCI6IjgwODAwMDMzMDU4MTM4NjkzNzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3c7779267824f4d15de8dd0b4634a6268384ad908f40cc9ab5c0cd01f0d7d8e9
hovercard-subject-tagissue:4907574227
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/8667/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2c8dc773793c393fd4c5ffbb8db1e9fa0da901ee32102a3df2a18f704428a346/IfcOpenShell/IfcOpenShell/issues/8667
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2c8dc773793c393fd4c5ffbb8db1e9fa0da901ee32102a3df2a18f704428a346/IfcOpenShell/IfcOpenShell/issues/8667
og:image:altDescribe the bug When project.append_asset appends a product whose type's GlobalId collides with an element of a different class already present in the destination file, the entire append aborts wi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametheoryshaw
hostnamegithub.com
expected-hostnamegithub.com
None1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/8667#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F8667
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%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F8667
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8667
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8667
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8667
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests937 (937)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8667
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8667
#8756https://github.com/IfcOpenShell/IfcOpenShell/pull/8756
#8669https://github.com/IfcOpenShell/IfcOpenShell/pull/8669
project.append_asset: TypeError aborts entire append when a library type's GlobalId collides with a different-class element in the destinationhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8667#top
#8756https://github.com/IfcOpenShell/IfcOpenShell/pull/8756
#8669https://github.com/IfcOpenShell/IfcOpenShell/pull/8669
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
https://github.com/theoryshaw
theoryshawhttps://github.com/theoryshaw
on Jul 17, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8667#issue-4907574227
theoryshawhttps://github.com/theoryshaw
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Jul 17, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8667#event-28100567974
petruconduraruhttps://github.com/petruconduraru
on Jul 25, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8667#event-28468245657
project.append_asset: reject GlobalId matches across incompatible cla…https://github.com/BIMvoice/IfcOpenShell/commit/a5bdfc5abe94034cba1bb6aeef5f2b2f68290347
https://docs.github.com/articles/closing-issues-via-commit-messages
a5bdfc5https://github.com/BIMvoice/IfcOpenShell/commit/a5bdfc5abe94034cba1bb6aeef5f2b2f68290347
theoryshawhttps://github.com/theoryshaw
on Oct 2, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8667#event-32361123497
project.append_asset: don't abort batch on GlobalId collision (IfcOpe…https://github.com/theoryshaw/IfcOpenShell/commit/adeed6f215e97517391970c61ffa3c4022d91e7d
IfcOpe…https://github.com/IfcOpenShell/IfcOpenShell/issues/8667
adeed6fhttps://github.com/theoryshaw/IfcOpenShell/commit/adeed6f215e97517391970c61ffa3c4022d91e7d
theoryshawhttps://github.com/theoryshaw
on Oct 11, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8667#event-33001687733
project.append_asset: don't abort batch on GlobalId collision (IfcOpe…https://github.com/theoryshaw/IfcOpenShell/commit/fad38cfda65b57a163bb07bd2b79d98efb83c12a
IfcOpe…https://github.com/IfcOpenShell/IfcOpenShell/issues/8667
fad38cfhttps://github.com/theoryshaw/IfcOpenShell/commit/fad38cfda65b57a163bb07bd2b79d98efb83c12a
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8667
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8667
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.