Repository navigation
chore(#454): re-verify callback-external guard + fix stale null-bundled comment - #455
Conversation
…x stale null comment Follow-up to epic #386 (all 6 backends extracted to external packages). Task 1 — callback-external guard (render.zig ~L181): re-checked, KEPT as-is. The guard was already correctly narrowed in #416: `callback_dispatch_handled` includes `cfg.backend == .sokol`, so external sokol-desktop (which resolves via builtinProvider + declares loop_style = .callback) is NOT rejected — the enum- as-shorthand preserves the `.sokol` tag and the callback dispatch has a real branch. The guard still protects two genuinely-unsupported live paths: (a) a third-party external callback backend whose `cfg.backend` sits at the `.raylib` default (would fall through to the raylib-wasm fallback), and (b) any external non-sokol backend on wasm (platform forces callback lifecycle, no dispatch branch). Added a regression-lock test asserting external sokol-desktop generates the sokol callback main instead of erroring. Task 2 — stale comment (cache_cmd.zig ~L545): fixed. `null` is no longer bundled (extracted to labelle-null); `builtinProvider(.null)` always returns a package and no arm returns null, so `effectiveBackendPackage()` for the tests-target null config always resolves. The real no-op is the `isPluginCached` guard (project already IS null → fetched above), not a null effective package. Claude-Session: https://claude.ai/code/session_017pW3ifKf9wgxNg4viy6okw
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR clarifies a comment in ChangesNull-backend caching comment and callback guard test
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Two low-risk cleanups from #454 (extraction tech-debt, follow-up to the completed epic #386).
1. Callback-external guard — investigated, kept (correct as-is) + regression test
src/codegen/lifecycle/render.zigExternalCallbackBackendUnsupportedis not dead code. It was already narrowed in #416: the guard fires only whenuse_callback_lifecycle and isExternal() and !callback_dispatch_handled, wherecallback_dispatch_handled = is_bgfx_android or cfg.backend == .sokol. External sokol-desktop (today's production state) keepscfg.backend == .sokolvia the enum-as-shorthand, so it's handled and the guard does NOT fire.The guard still protects two genuinely-unsupported live paths: (1) a 3rd-party external callback backend sitting at the
.raylibenum default, and (2) any external non-sokol backend on wasm. Added a regression test asserting external sokol-desktop generates the sokol callbackmainrather than erroring — fails loudly if anyone dropscfg.backend == .sokolfromcallback_dispatch_handled.2. Stale comment (
src/cache_cmd.zig)"no-op when null is still bundled" was wrong post-extraction (
null→labelle-null, nobuiltinProviderarm returns null). Rewrote to state the real no-op is theisPluginCachedguard. Comment-only; logic unchanged.zig build test+zig buildboth exit 0.Ref #454, #386.
https://claude.ai/code/session_017pW3ifKf9wgxNg4viy6okw
Summary by CodeRabbit
Bug Fixes
Tests
sokoldesktop backend with callback-based execution.