Conversation
…ling, robust logging, and failure state tracking in AppState
…nsition to sync-based updates in MacInfoSyncManager
… messages and increase the weak connection threshold
…ct state validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and fixes across BLE communication, menu bar visibility, license validation, and media info streaming. The most significant changes include a robust streaming implementation for now-playing media info, enhanced error handling and user feedback for license validation, and new state management for menu bar visibility. These updates collectively improve the app's reliability, user experience, and maintainability.
Now Playing Media Streaming:
NowPlayingCLIclass to support real-time streaming of media info using themedia-control stream --no-diffcommand, with automatic retry logic and robust JSON parsing for each line of output. This replaces the previous one-shot fetch approach and provides more responsive updates.License Validation and Error Handling:
LicenseCheckErrorenum to include more granular error cases (e.g., invalid key, plan mismatch, subscription inactive, uses exceeded, refunded) and user-friendly error descriptions.checkLicenseKeyValiditymethod inGumroad.swiftto provide detailed logging, handle various error scenarios with clear messages, and updateAppStatewith the last license check failure reason for UI feedback.Menu Bar Visibility and State Management:
showInMenubarproperty toAppStatewith persistence toUserDefaults, ensuring the menu bar item can be shown or hidden based on user preference or app state. [1] [2]MenuBarManagerto observeshowInMenubarand toggle the menu bar item’s visibility accordingly. Also ensured the menu bar is always shown when the dock icon is hidden. [1] [2] [3]BLE Communication Improvements:
.withResponseor.withoutResponsebased on characteristic properties, improving compatibility and reliability.forceRefresh()instead offetch()for more accurate media info.Other State and Error Management:
lastLicenseCheckFailureReasontoAppStateto store the reason for the most recent license validation failure, enabling better user feedback in the UI.These changes collectively enhance the user experience, reliability, and maintainability of the application.