fix(ios): use pointer receivers on IOSDevice to stop copying its mutex - #357
fix(ios): use pointer receivers on IOSDevice to stop copying its mutex#357gmegidish wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe change converts ChangesiOS pointer-based device model
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR changes IOSDevice handling to use pointers so its mutex is not copied, with related list and test updates. It is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
0545812 to
9fd2aee
Compare
Fixes all 30 govet
copylocksfindings.IOSDevicecontains async.Mutex(protecting the port forwarders and deviceKit state), but 28 methods used value receivers — every call copied the struct, mutex included, so the lock never actually guarded shared state. The constructor andListIOSDevicesalso copied the struct by value.Changes:
IOSDevicemethods now use*IOSDevicereceivers (matchingStartAgent/StartScreenCapture, which already did)getDeviceInforeturns*IOSDevice;ListIOSDevicesreturns[]*IOSDeviceGetDeviceInfoListin common.go appends the pointers directly instead of&iosDevices[i]Verified:
go build ./...,go vet ./...,go test ./...all pass; golangci-lint govet count is 0 (was 30).Summary by CodeRabbit
Improvements
Tests