Skip to content

Develop - Optimizations - #281

Merged
sameerasw merged 14 commits into
mainfrom
develop
Jul 24, 2026
Merged

Develop - Optimizations#281
sameerasw merged 14 commits into
mainfrom
develop

Conversation

@sameerasw

Copy link
Copy Markdown
Owner

This pull request introduces significant improvements to device connection management, BLE stability, and clipboard synchronization in the AppState and BLECentralManager classes. The main focus is on making BLE and Wi-Fi connections more robust and user-friendly, optimizing clipboard sync, and improving device name and wallpaper handling for BLE connections.

Connection management and BLE stability:

  • Added a Wi-Fi stability timer in BLECentralManager to ensure BLE is only disconnected after Wi-Fi has been stably connected for 5 seconds, preventing premature BLE disconnects if Wi-Fi is unstable. (F973f901L41R41)
  • Refactored connection checks throughout to use a new isRegularConnection property, improving code clarity and reliability for distinguishing between BLE and Wi-Fi connections. [1] [2] [3] [4] [5]
  • Improved BLE connection state handling by resetting device state and internal variables on disconnect, and ensuring BLE scanning resumes appropriately. [1] [2] [3] [4]

Clipboard synchronization improvements:

  • Optimized clipboard monitoring by increasing the polling interval to 2.5 seconds and using NSPasteboard.changeCount to avoid unnecessary syncs and reduce CPU usage. [1] [2] [3]

Device name and wallpaper handling:

  • Introduced AppState.getPreferredDeviceName(fallback:) to consistently use the last regular device name for BLE connections, improving device identification. [1] [2]
  • Enhanced BLE connection experience by reusing cached wallpapers for BLE devices, loading from UserDefaults or disk if available.

Settings and user defaults:

  • Added the isAutoSwitchWithBLEEnabled setting, persisted in UserDefaults and integrated with DiscoveryManager, giving users more control over BLE auto-switch behavior. [1] [2]

BLE service discovery and authentication:

  • Improved BLE service discovery logic by switching from a simple counter to a set of discovered service UUIDs, and ensuring authentication is only attempted once after all expected services are discovered. [1] [2] [3]

These changes collectively improve connection reliability, user experience, and code maintainability.

sameerasw added 14 commits July 23, 2026 11:14
…lement direct pairing/connection logic with socket verification.
…hability logic, and update UI component transitions and sizing
…ize service authentication tracking in BLE central manager
…disconnect logic upon stable Wi-Fi connection
…lls with PATH environment variable iteration
…n WebSocket server using new data-based decryption methods
@sameerasw sameerasw self-assigned this Jul 24, 2026
@sameerasw sameerasw added the enhancement New feature or request label Jul 24, 2026
@sameerasw
sameerasw merged commit bb3d105 into main Jul 24, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in AirSync Features and Bugs Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant