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

supabase / supabase-swift / 31011736834

05 Aug 2026 01:45PM UTC coverage: 83.849% (-0.04%) from 83.888%
31011736834

push

github

web-flow
refactor(auth): deprecate customizable JSON encoder/decoder (#1165)

* refactor(auth): deprecate customizable JSON encoder/decoder

There is no real use case for customizing Auth's JSON encoding/decoding
per-instance. Deprecate `Configuration.encoder`/`.decoder` and the
init overloads that accept them, in favor of new inits that always use
the internal default. Behavior is unchanged for now (deprecated inits
still honor a custom encoder/decoder) -- this only starts the removal
path for a future major version.

Internal call sites now read a non-deprecated `resolvedEncoder`/
`resolvedDecoder` pair instead of the deprecated public properties, to
keep the SDK's own code warning-free.

* fix(auth): restore single-codec deprecated init overloads

The new encoder/decoder-accepting init required both arguments, so a
caller previously passing only encoder: (or only decoder:) on the
fuller-signature init (with logger/redirectToURL/etc.) no longer
compiled. Add encoder-only and decoder-only deprecated overloads,
alongside the existing both-codecs one, each defaulting the omitted
codec. Add compile coverage for all four single-codec call forms.

* fix(ci): add "initializers" to spell-check dictionary

Plural form was missing from all bundled cspell dictionaries, failing
CI on Sources/Auth/AuthClientConfiguration.swift.

* fix(ci): disable parallel test execution in xcodebuild test runs

withMainSerialExecutor (ConcurrencyExtras) hooks a process-wide task-enqueue
global, not just the calling suite's own tasks. Swift Testing's default
parallel execution runs unrelated suites concurrently in the same process, so
while any withMainSerialExecutor-gated suite (AuthClientTests, SessionManagerTests,
RealtimeTests, RealtimeIntegrationTests) holds that hook, every other
concurrently-running suite's tasks get silently forced onto the same serial
queue too. Under CI's loaded iOS Simulator this backs up enough to blow
through hardcoded test timeouts (e.g. AuthClientTests.ass... (continued)

87 of 93 new or added lines in 11 files covered. (93.55%)

27 existing lines in 4 files now uncovered.

8452 of 10080 relevant lines covered (83.85%)

40.22 hits per line

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

41.67
/Sources/Auth/Storage/KeychainLocalStorage.swift
1
#if !os(Windows) && !os(Linux) && !os(Android)
2
  public 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.
24
    public func store(key: String, value: Data) throws {
×
25
      try keychain.set(value, forKey: key)
×
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? {
4✔
34
      try keychain.data(forKey: key)
4✔
UNCOV
35
    }
×
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.
41
    public func remove(key: String) throws {
×
42
      try keychain.deleteItem(forKey: key)
×
43
    }
×
44
  }
45
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc