fix: pass opts.name to serpent to correct reference deserialize#2672
fix: pass opts.name to serpent to correct reference deserialize#2672
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdates to serialization and runtime wiring: serpent calls now include Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/libuv_spec.lua`:
- Around line 202-212: The test currently only checks behavior of deserialized
functions; update the "serialize/deserialize with shared function reference"
test to also assert identity preservation by adding an assertion that
deserialized.fn1 == deserialized.fn2 after deserialization (retain checks using
libuv.serialize and libuv.deserialize and existing type/return-value assertions
for fn1 and fn2).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5ffd6eec-3724-410e-b8ca-ccdfb22fb956
📒 Files selected for processing (5)
lua/fzf-lua/libuv.lualua/fzf-lua/previewer/builtin.lualua/fzf-lua/test/exec_lua.luatests/headless_spec.luatests/libuv_spec.lua
Before, obj/func ref is sometimes deserialized as nil since:
1. serpent don't know who fn1 before the full table is returned since
the serialized data is a compact version to ensure func/obj ref is
consistant
2. lua table is random, so it's also possible to deserialize fn2
correctly, but fn1=nil
```
return { fn1 = my_func, fn2 = fn1 }
```
Apply opts.name="_" for serpent, it would be like:
```
local _ = { fn1 = my_func }
_.fn2 = _.fn1
return _
```
ci: pass exec_lua function
ci: refactor test
Before, obj/func ref is sometimes deserialized as nil since:
the serialized data is a compact version to ensure func/obj ref is
consistant
correctly, but fn1=nil
Apply opts.name="_" for serpent, it would be like:
Summary by CodeRabbit
Refactor
Tests