Repository navigation
fix(worker): throw when an environment-data key cannot be converted to a string - #2066
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughEnvironment-data callbacks now convert keys with V8 in the current context and stop if conversion fails. Regression tests cover NUL-containing keys, deletion, and exceptions thrown during key conversion. ChangesEnvironment-data key handling
Priority: ⚪ Not assessed Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Failed key conversions now reach callers instead of accessing the empty-string entry, and the reviewed changes show no material merge risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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. A rabbit taps a key with care Comment |
c38bdae to
8adf08f
Compare
…o a string setEnvironmentData and getEnvironmentData converted the key with a helper that swallows a throwing toString() and returns an empty string, so such a key silently read, overwrote or deleted the unrelated empty-string entry. The conversion is checked now and the exception reaches the caller.
8adf08f to
1e23b14
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
setEnvironmentData(key, value)with a key whosetoString()throws does not throw. It stores the value under the empty-string key instead, replacing whatever was there, andgetEnvironmentData(key)andsetEnvironmentData(key)read or delete that unrelated entry.Both callbacks convert the key with a helper that swallows a throwing
toString()and returns an empty string. They now convert it with a checkedToStringand return with the exception pending, so it reaches the caller. Keys stay stringified, as the sharedstringifies keysspec expects. A symbol key now throws aTypeError, as any string conversion of a symbol does, rather than mapping to the empty-string key.Stacked on #2043; the same fix for iOS is NativeScript/ios#492. The throwing-key spec fails on that branch and passes here, a second spec keeps a key with an embedded NUL distinct from its prefix, and the full device suite passes.
Summary by CodeRabbit