Skip to content

Conversation

@mentatbot
Copy link

@mentatbot mentatbot bot commented Apr 13, 2025

This commit resolves the remaining Swift compiler errors identified in the codebase:

  1. Duplicate declarations:

    • Renamed clearUpdateState in CoreDataManager+Certificates to clearUpdateStateForCertificate
    • Used clearUpdateStateCompat in LibraryViewController
    • Fixed importFile method conflicts
    • Replaced duplicate LEDIndicatorType with a better implementation
  2. Missing functionality:

    • Added saveImage method to ImageCache class
    • Fixed TerminalService's session ID handling
    • Made getUniqueFileName static with proper filesystem access
  3. API compatibility:

    • Added @available checks for iOS 16's invalidateDetents()
    • Replaced unsupported prefersModalPresentation with iOS 15 alternatives
  4. Type system fixes:

    • Modified SigningOptions to properly handle non-Codable types
    • Added explicit error conversions to fix "cannot be converted to Never" errors
    • Fixed type annotations for closure parameters

These changes address all the compiler errors while maintaining the intended functionality of the app.


🤖 See my steps and cost here

#2

  • Wake on any new activity.

This commit resolves the remaining Swift compiler errors identified in the codebase:

1. Duplicate declarations:
   - Renamed `clearUpdateState` in CoreDataManager+Certificates to `clearUpdateStateForCertificate`
   - Used `clearUpdateStateCompat` in LibraryViewController
   - Fixed `importFile` method conflicts
   - Replaced duplicate LEDIndicatorType with a better implementation

2. Missing functionality:
   - Added `saveImage` method to ImageCache class
   - Fixed TerminalService's session ID handling
   - Made `getUniqueFileName` static with proper filesystem access

3. API compatibility:
   - Added @available checks for iOS 16's `invalidateDetents()`
   - Replaced unsupported `prefersModalPresentation` with iOS 15 alternatives

4. Type system fixes:
   - Modified SigningOptions to properly handle non-Codable types
   - Added explicit error conversions to fix "cannot be converted to Never" errors
   - Fixed type annotations for closure parameters

These changes address all the compiler errors while maintaining the intended functionality of the app.
@mentatbot mentatbot bot requested a review from stayaway245 April 13, 2025 07:40
@mentatbot
Copy link
Author

mentatbot bot commented Apr 13, 2025

Swift Compiler Error Fixes

This PR addresses the remaining Swift compiler errors that were identified in your list. Here's a detailed breakdown of the fixes:

1. Duplicate Method Declarations

Fixed various name conflicts and duplicate implementations:

  • clearUpdateState conflict: Renamed the implementation in CoreDataManager+Certificates.swift to clearUpdateStateForCertificate and updated the caller in LibraryViewController to use the compatibility method clearUpdateStateCompat

  • importFile method conflicts: Modified DirectoryViewControllerExtensions.swift to check if the instance is a HomeViewController before calling importFile()

  • LEDIndicatorType duplicate enum: Replaced the duplicate enum in HomeViewController+FileUploadFix.swift with a more integrated solution using the existing UIView+LED extension

2. Missing Method Issues

  • CoreDataManager.saveImage: Added a saveImage method to ImageCache class and updated the caller in LibraryViewController+IconFix.swift

  • TerminalService.currentSessionId: Fixed TerminalViewController to use the existing sessionId property instead of the non-existent currentSessionId

  • getUniqueFileName accessibility: Made getUniqueFileName static and accessible from other files, fixing the static access to document paths

3. iOS API Compatibility

  • invalidateDetents(): Added proper @available(iOS 16.0, *) checks and fallback code for iOS 15 devices

  • prefersModalPresentation: Replaced with iOS 15 compatible alternatives like setting prefersGrabberVisible and detents

4. Type System Fixes

  • SigningOptions Codable conformance: Modified customEntitlements to use a private storage property with proper Codable support and added conversion methods

  • Error conversion fixes: Added explicit as Error casts to prevent "cannot be converted to Never" errors

  • Closure parameter types: Added proper type annotations to closure parameters

5. Other Fixes

  • protocol reserved keyword: Used a computed property with CodingKeys to replace the reserved keyword

  • Conditional bindings: Fixed optional handling for getCertificates method call

Let me know if you'd like any clarification or have questions about any of the specific fixes!

@stayaway245 stayaway245 merged commit 8c1bc19 into main Apr 13, 2025
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