• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-swift / 28790931276

06 Jul 2026 12:18PM UTC coverage: 81.251% (+0.5%) from 80.798%
28790931276

push

github

web-flow
chore: clean up code made obsolete by the iOS 16+ minimum (#1075)

* chore: clean up code made obsolete by the iOS 16+ minimum

Now that platform minimums are iOS 16 / macOS 13 / watchOS 9 / tvOS 16
(#1067), flatten @available/#available checks that are always
satisfied and remove the code paths/polyfills they guarded:

- Helpers/_Clock.swift: drop the FallbackClock/_resolveClock
  indirection now that ContinuousClock/TestClock are unconditionally
  available; keep the `_Clock` protocol as the DEBUG-only test seam.
- Auth WebAuthn (AuthClient+Passkey, AuthMFA+WebAuthn,
  WebAuthnAuthenticator) and SupabaseClient: remove now-redundant
  @available/#available gates (some had unreachable else branches).
- AuthClient, Realtime/Deprecated (PhoenixTransport, RealtimeClient),
  OSLogSupabaseLogger, Helpers/Version: remove @available annotations
  gated below the new floor.
- Helpers/DateFormatter, Storage/Helpers, Storage/MultipartFormData:
  drop the pre-iOS-15/14 DateFormatter and UTType polyfills, since the
  modern APIs are now unconditionally available.
- Matching test-side cleanup: drop redundant class-level @available
  annotations tied to the old floor, and update PostgrestBuilderTests
  to reset the clock via ContinuousClock() directly.

Linear: SDK-1225

* refactor: drop custom _Clock protocol, use stdlib Clock directly

The wrapper protocol only existed to abstract over Clock/ContinuousClock's
pre-iOS 16 unavailability. Now that Clock is unconditionally available,
add sleep(for: TimeInterval) as a constrained extension on the stdlib
Clock protocol instead, and store/inject `any Clock<Duration>` directly.

Linear: SDK-1225

* fix: finish Storage MIME-type polyfill cleanup, drop unrelated diff noise

Per code review on the SDK-1225 cleanup:
- Storage/Helpers.swift, Storage/MultipartFormData.swift: the
  UTType/CoreFoundation MIME-type polyfill was only half-removed —
  drop the dead UTTypeCreatePreferredIdentifierForTag fallback (now
  unreachable o... (continued)

22 of 23 new or added lines in 11 files covered. (95.65%)

252 existing lines in 9 files now uncovered.

7627 of 9387 relevant lines covered (81.25%)

37.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/Sources/Auth/Storage/KeychainLocalStorage.swift
1
#if !os(Windows) && !os(Linux) && !os(Android)
2
  import Foundation
3

4
  /// ``AuthLocalStorage`` implementation using Keychain. This is the default local storage used by the library.
5
  public struct KeychainLocalStorage: AuthLocalStorage {
6
    private let keychain: Keychain
7

8
    /// Creates a Keychain-backed storage instance.
9
    ///
10
    /// - Parameters:
11
    ///   - service: The Keychain service name used to namespace stored items.
12
    ///     Defaults to `"supabase.gotrue.swift"`.
13
    ///   - accessGroup: An optional Keychain access group for sharing items between apps.
14
    public init(service: String? = "supabase.gotrue.swift", accessGroup: String? = nil) {
1✔
15
      keychain = Keychain(service: service, accessGroup: accessGroup)
1✔
16
    }
1✔
17

18
    /// Stores `value` in the Keychain under `key`.
19
    ///
20
    /// - Parameters:
21
    ///   - key: The Keychain item key.
22
    ///   - value: The raw bytes to store.
23
    /// - Throws: A Keychain error if the write fails.
UNCOV
24
    public func store(key: String, value: Data) throws {
×
UNCOV
25
      try keychain.set(value, forKey: key)
×
UNCOV
26
    }
×
27

28
    /// Returns the data stored in the Keychain for `key`, or `nil` if not present.
29
    ///
30
    /// - Parameter key: The Keychain item key.
31
    /// - Returns: The stored bytes, or `nil` if the item does not exist.
32
    /// - Throws: A Keychain error if the read fails.
33
    public func retrieve(key: String) throws -> Data? {
1✔
34
      try keychain.data(forKey: key)
1✔
35
    }
1✔
36

37
    /// Removes the Keychain item for `key`.
38
    ///
39
    /// - Parameter key: The Keychain item key to delete.
40
    /// - Throws: A Keychain error if the delete fails.
UNCOV
41
    public func remove(key: String) throws {
×
UNCOV
42
      try keychain.deleteItem(forKey: key)
×
UNCOV
43
    }
×
44
  }
45
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc