fix(rivetkit): bind methods through createWriteThroughProxy#4987
Conversation
|
🚅 Deployed to the rivet-pr-4987 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code Review: PR #4987 -- fix(rivetkit): bind methods through createWriteThroughProxyOverviewThis PR fixes a serialization bug where inspector state fails to serialize non-trivial values like The fix replaces the hand-rolled proxy with The approach is sound and the test coverage is comprehensive. Issues1. RegExp was previously allowed but is now rejected The old 2. Non-finite number validation regression The old if (typeof value === 'number') {
if (!Number.isFinite(value)) {
throw new TypeError(
`Value at ${path || 'root'} is non-finite (NaN/Infinity) and is not CBOR serializable`
);
}
return;
}3. Any existing serialized actor state shaped like a two-element array starting with 4. onValidate(_path: string, newValue: unknown) {
beforeChange?.(newValue);
return true;
},The unconditional Minor Notes
SummaryThe core fix is correct and well-motivated. The two behavioral regressions (non-finite numbers, |
b150344 to
fc4756e
Compare
af6e0e4 to
3be897d
Compare
3be897d to
c39972c
Compare
fc4756e to
5ec0839
Compare
5ec0839 to
4ff7adb
Compare
c39972c to
add44af
Compare
add44af to
4455290
Compare
4455290 to
caa9ace
Compare
436c4a6 to
b18ec51
Compare
caa9ace to
6e0dfcb
Compare

Fixes an error that occurs when inspector state attempts to serialize non trivial values (ie
Date).