Pre-release code review: safety, formatting, view extraction, and concurrency fixes#11
Open
Pre-release code review: safety, formatting, view extraction, and concurrency fixes#11
Conversation
9e7ae1b to
b815fa2
Compare
|
Failed to generate code suggestions for PR |
0ff122f to
f660ea6
Compare
…d PR Agent config - Replace force-unwraps in StatusBarController with safe Optional/Task patterns - Expand DeviceDTO.isGateway to match router/USG models and wan feature flag - Switch WiFiStatus byte formatting to 1000-based units (matching SpeedTestResult) - Fix DDNSStatusDTO.id to use meaningful defaults instead of empty strings - Cache DateFormatter in DiagnosticsLog as stored property - Extract dedicated view structs: DiagnosticsSection, NotConfiguredView, MenuErrorView, MenuFooterView, SectionToggleRow - Guard PreferencesView launchAtLogin onChange against initial-load trigger - Add Formatters utility for shared RelativeDateTimeFormatter - Add unit tests for WiFiStatus, PreferencesManager, UpdateChecker, UniFiError, and DecodeFlexibleArray - Remove hardcoded Preferences window height (let contentSize drive it) - Remove Alerts and Security (IPS) sections — legacy endpoints with no real data - Fix wired Ethernet: iterate all en* IPs against UniFi client list, fall back to minimal wired view when Mac IP isn't in UniFi (e.g. non-UniFi router) - Add site ID cache reset on discovery errors so stale IDs get cleared - Add NSLocalNetworkUsageDescription to Info.plist (required for App Store) - Use activate(ignoringOtherApps: true) for reliable window foregrounding - Configure PR Agent to run on synchronize events via GITHUB_ACTION_CONFIG - Increase PR Agent timeout to 30 minutes - Add .env to .gitignore AI assisted to create this change
f660ea6 to
681da97
Compare
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.
User description
Summary
StatusBarControllerwith safeOptional/Taskpatterns — eliminates potential crashes when optional data is nilSpeedTestResult— consistent Mbps/Gbps across the UIsome Viewproperties into dedicated structs (DiagnosticsSection,NotConfiguredView,MenuErrorView,MenuFooterView,SectionToggleRow) — follows SwiftUI best practices for stable identity and testabilityDateFormatterinDiagnosticsLogas a stored property instead of creating inline on every callDeviceDTO.isGatewayto match USG/router models and devices withwanfeature flag"unknown","ddns") instead of empty strings inDDNSStatusDTO.idlaunchAtLoginonChange against initial-load trigger loop; remove hardcoded window height socontentSizedrives layout naturallyTest plan
swift buildpasses with zero warnings (Swift 6 strict concurrency)swift testpasses (42/42)PR Type
Enhancement, Bug fix, Tests
Description
Security: Keychain cert pinning, cert change detection, HTTP header injection guard, HTTPS-only, response caps
kSecAttrAccessibleWhenUnlockedThisDeviceOnly)Monitoring: Added alarms, IDS/IPS, DDNS, port forwards, and nearby APs sections
fetchAlarms,fetchIPSEvents,fetchDDNSStatus,fetchPortForwards,fetchRogueAPsendpointsError handling: Exponential backoff, auth failure stops polling, detailed error states
ErrorStatenow carries reason strings and HTTP codescertChangederror state with reset button in UIDiagnostics: Event log, copy report, section preferences, update checker, unit tests
Diagram Walkthrough
File Walkthrough
16 files
Security hardening, monitoring endpoints, flexible decodeError handling, exponential backoff, monitoring fetch loopRedesigned UI with sections, diagnostics, and cert resetSection visibility, monitoring sections, extracted viewsError state refactoring, monitoring fields, decimal unitsNew monitoring DTOs with safe display formattingParameterized view signatures replacing WiFiStatus dependenciesEvent logging with categories and text exportHTTPS-only validation and improved error messagesPeriodic update checking utilityCollapsible section UI componentIDS/IPS events display sectionNearby/rogue APs display sectionDynamic DNS status display sectionPort forwarding rules display sectionController alarms display section4 files
Unit tests for WiFiStatus formatting and stateUnit tests for PreferencesManagerUnit tests for flexible JSON array decoderUnit tests for UpdateChecker20 files