fix(lib): give each thread its own VCDiffDecoder - #1240
Conversation
The shared static decoder keeps per-decode state, so two channels decoding on different threads at the same time corrupt each other's deltas (40018, then a re-attach). Use a ThreadLocal instead.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough
ChangesThread-local VCDiff decoding
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The decoder isolation change preserves recovery behavior, and no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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. A rabbit checks the decoder thread by thread Comment |
The shared static decoder keeps per-decode state, so two channels decoding on different threads at the same time were corrupting each other's deltas (40018, then a re-attach). Use a ThreadLocal instead.
Use older syntax for backwards compatibility.
I can add tests if you'd like, but it felt like a lot of ceremony to verify a pretty clear fix.
Summary by CodeRabbit