René's URL Explorer Experiment


Title: Bonsai: fix "Instance not found" crash when removing a stale presentation layer by petruconduraru · Pull Request #8384 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Bonsai: fix "Instance not found" crash when removing a stale presentation layer by petruconduraru · Pull Request #8384 · IfcOpenShell/IfcOpenShell

X Title: Bonsai: fix "Instance not found" crash when removing a stale presentation layer by petruconduraru · Pull Request #8384 · IfcOpenShell/IfcOpenShell

Description: Reported by @Vanuan in #4934. Removing a presentation layer after clicking the layer icons in sequence could raise RuntimeError: Instance #xxxx not found. Root cause: the layer list draws from props.layers and bakes each layer's IfcPresentationLayerAssignment id into its row buttons at draw time. The remove/assign/unassign/enable/select operators then called ifc_file.by_id(self.layer) with no validation. Presentation layers are removed automatically once they have no assigned items left (an IfcPresentationLayerAssignment must keep at least one item to stay schema valid), so unassigning the last item deletes the layer. If that baked id reaches an operator after the entity is gone (queued clicks, or a redraw that has not yet reloaded the list), by_id raises "Instance #N not found" and the operator crashes. Fix: a shared resolve_layer guard resolves the UI supplied id against current state. If the id no longer references a presentation layer it reloads the layer list so the stale row disappears, warns the user and returns None so the operator cancels cleanly. All operators that take a layer id from the UI now go through it. Normal behaviour is unchanged: removing an existing layer still works and the active selection stays sensible. Verified in a live Blender session across the paths from the report: Stale id sequence: assign a layer to an object, unassign so the layer is emptied and auto removed, then assign again on the same id. Before this fix that raised RuntimeError: Instance #N not found; now the operator reports "Presentation layer no longer exists, the layer list has been refreshed" and cancels cleanly with no traceback. Rapid repeated assign and unassign across several objects: no crash. IfcPresentationLayerWithStyle layers (the on, frozen and blocked icons from the original report): no crash, and a layer assigned to a single item is correctly removed when that item is unassigned. black, ruff and ty are clean on the changed file. Fixes #4934 Generated with the assistance of an AI coding tool.

Open Graph Description: Reported by @Vanuan in #4934. Removing a presentation layer after clicking the layer icons in sequence could raise RuntimeError: Instance #xxxx not found. Root cause: the layer list draws from prop...

X Description: Reported by @Vanuan in #4934. Removing a presentation layer after clicking the layer icons in sequence could raise RuntimeError: Instance #xxxx not found. Root cause: the layer list draws from prop...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8384

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:85243b6f-472b-5c75-4666-ca23ac124ad4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8CC6:17B2AF:110BA7F:1630A99:6B04F4C8
html-safe-noncee7824162d2bc10e208df27f282515b80ab1f48d45b09604773313b2339e78191
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0M2OjE3QjJBRjoxMTBCQTdGOjE2MzBBOTk6NkIwNEY0QzgiLCJ2aXNpdG9yX2lkIjoiNDM3OTc1ODg1NTY4NTczMTUyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac477ae0551c679101c6b1b54ee0b850593c83d649bd2a57acde4b5a1663b6af00
hovercard-subject-tagpull_request:4012212330
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/IfcOpenShell/IfcOpenShell/pull/8384/files
twitter:imagehttps://avatars.githubusercontent.com/u/139251053?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/139251053?s=400&v=4
og:image:altReported by @Vanuan in #4934. Removing a presentation layer after clicking the layer icons in sequence could raise RuntimeError: Instance #xxxx not found. Root cause: the layer list draws from prop...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2c3971d6ab4be607cf9a26ac26ef0a7bfce380ec2ba14642e64028ad07a492b9
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3f1d45dee14b3f87c64e9017a9c08d011561786
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fpull%2F8384%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%2FIfcOpenShell%2FIfcOpenShell%2Fpull%2F8384%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=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
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 requests936 (936)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
Sign up for GitHub https://github.com/signup?return_to=%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2Fnew%2Fchoose
petruconduraruhttps://github.com/petruconduraru
IfcOpenShell:v0.9.0https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.9.0
BIMvoice:fix-4934-presentation-layer-stale-idhttps://github.com/BIMvoice/IfcOpenShell/tree/fix-4934-presentation-layer-stale-id
Conversation 0 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384
Commits 4 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/commits
Checks 6 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/checks
Files changed https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
Bonsai: fix "Instance not found" crash when removing a stale presentation layer https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#top
Show all changes 4 commits https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
bca2e6d Bonsai: guard presentation layer operators against stale UI ids #4934 petruconduraru Jul 8, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/commits/bca2e6db216022d4e60a52f93b15f3a8a192e98c
3575049 Merge origin/v0.9.0 into mig/8384 petruconduraru Sep 29, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/commits/3575049503f2e03bcc226ef27bc64666420ef134
e9277f3 Test stale presentation layer id is ignored petruconduraru Sep 29, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/commits/e9277f3f088b12090c5b727c89d204b17d9148af
2efb1f1 Use walrus guards for resolved layers petruconduraru Sep 29, 2026 https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/commits/2efb1f19693ed2603243c5de56af0c4b8d17082f
Clear filters https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files
operator.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
__init__.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-2c0b5cb21b0d336a385642b3fe368ba8f587ce0e0dcb81a245ea19d60188a343
test_operator.py https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-cc25285c02398defbe8387c78da55585fb4425ae902d1da0b42fc6c473e938f4
src/bonsai/bonsai/bim/module/layer/operator.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/2efb1f19693ed2603243c5de56af0c4b8d17082f/src/bonsai/bonsai/bim/module/layer/operator.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/{{ revealButtonHref }}
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-47c78e288f618f55a68c3935f0faf433bbf9e8e1dca21b0b17a845835dd90fc3
src/bonsai/test/bim/module/layer/__init__.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-2c0b5cb21b0d336a385642b3fe368ba8f587ce0e0dcb81a245ea19d60188a343
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/2efb1f19693ed2603243c5de56af0c4b8d17082f/src/bonsai/test/bim/module/layer/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/{{ revealButtonHref }}
src/bonsai/test/bim/module/layer/test_operator.pyhttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/files#diff-cc25285c02398defbe8387c78da55585fb4425ae902d1da0b42fc6c473e938f4
View file https://github.com/IfcOpenShell/IfcOpenShell/blob/2efb1f19693ed2603243c5de56af0c4b8d17082f/src/bonsai/test/bim/module/layer/test_operator.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/IfcOpenShell/IfcOpenShell/pull/8384/{{ revealButtonHref }}
Please reload this pagehttps://github.com/IfcOpenShell/IfcOpenShell/pull/8384/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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.