Skip to content

Comments

Fix: Multitouch stability during rapid system changes#113

Merged
NullPointerDepressiveDisorder merged 3 commits intomainfrom
fix/rapid-system-changes
Feb 21, 2026
Merged

Fix: Multitouch stability during rapid system changes#113
NullPointerDepressiveDisorder merged 3 commits intomainfrom
fix/rapid-system-changes

Conversation

@NullPointerDepressiveDisorder
Copy link
Owner

Description

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🧪 Test improvement

Related Issues

Testing Performed

  • Tested with built-in trackpad
  • Tested with Magic Trackpad (if available)
  • Verified system gestures (Mission Control, etc.) still work
  • Tested in target apps (list any specific apps tested):

Checklist

  • My code follows the project's code style guidelines
  • I have tested my changes thoroughly
  • I have added comments for non-obvious logic
  • My changes don't break existing functionality
  • I have updated documentation if needed

Code Coverage

  • I have added tests for new functionality (where applicable)
  • My changes meet the 80% patch coverage requirement

Note: Codecov will automatically check patch coverage. PRs that don't meet the 80% threshold will fail the coverage check. Files in MiddleDragTests/, AppDelegate.swift, MiddleDragApp.swift, and UpdateManager.swift are excluded from coverage requirements.

Screenshots / Recordings

Additional Notes

Copilot AI review requested due to automatic review settings February 21, 2026 07:52
@sentry
Copy link
Contributor

sentry bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
MiddleDrag/Managers/DeviceMonitor.swift 22.22% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses multitouch stability issues during rapid system changes by increasing timeout delays and adding safety checks. The changes aim to prevent race conditions and crashes (CFRelease(NULL), EXC_BREAKPOINT) that occur when the MultitouchSupport framework's internal thread interacts with device lifecycle operations during rapid connectivity changes or system state transitions.

Changes:

  • Increased restartCleanupDelay from 0.5s to 1.0s (100% increase) and minimumRestartInterval from 0.6s to 2.5s (316% increase) to provide more time for framework cleanup
  • Added redundant safety check in device callback to verify monitor is still running
  • Updated test timeouts and assertion thresholds to match new delay values

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
MiddleDrag/Managers/MultitouchManager.swift Doubled restartCleanupDelay to 1.0s and increased minimumRestartInterval to 2.5s; removed empirical evidence comments
MiddleDrag/Managers/DeviceMonitor.swift Doubled frameworkCleanupDelay to 1.0s; added redundant isRunning check in callback; changed access modifiers to fileprivate
MiddleDrag/MiddleDragTests/MultitouchManagerTests.swift Increased test timeouts from 1.0s to 3.0s, 2.0s to 5.0s, 3.0s to 5.0s; updated assertion thresholds for delay constants
MiddleDrag/MiddleDragTests/DeviceMonitorTests.swift Updated frameworkCleanupDelay assertion threshold from 0.5s to 1.0s

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
@NullPointerDepressiveDisorder NullPointerDepressiveDisorder merged commit 37b09b2 into main Feb 21, 2026
6 checks passed
@NullPointerDepressiveDisorder NullPointerDepressiveDisorder deleted the fix/rapid-system-changes branch February 21, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant