Skip to content

Logger: NSLock guaranteed#86

Merged
kieran-osgood-shopify merged 1 commit into
mainfrom
kieran-osgood/swift6/synchronous-logger-state
Jun 15, 2026
Merged

Logger: NSLock guaranteed#86
kieran-osgood-shopify merged 1 commit into
mainfrom
kieran-osgood/swift6/synchronous-logger-state

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented May 13, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

See #85 for explanation on the new LockedValue container
Aside from that not much to say about this PR, it uses LockedValue to make concurrent access to the shared logger safe

How to test


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in platforms/swift/ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@kieran-osgood-shopify kieran-osgood-shopify mentioned this pull request May 13, 2026
11 tasks
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.66% (319/348) 87.86% (181/206) 100% (82/82)

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 1b2c323 to a9cef3b Compare June 11, 2026 08:54
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from 0763c3b to 0955280 Compare June 11, 2026 09:33
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from a9cef3b to 0690561 Compare June 11, 2026 09:33
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from 0955280 to c7e8091 Compare June 11, 2026 10:01
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 0690561 to 29a0e02 Compare June 11, 2026 10:01
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from c7e8091 to 945d4b6 Compare June 11, 2026 10:23
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 29a0e02 to 673bb39 Compare June 11, 2026 10:23
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from 945d4b6 to fe87622 Compare June 11, 2026 10:32
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 673bb39 to 29722dd Compare June 11, 2026 10:32
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/swift6/configure-only-checkoutkit-state to graphite-base/86 June 11, 2026 12:06
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 29722dd to 7c8db7f Compare June 11, 2026 13:08
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from graphite-base/86 to kieran-osgood/swift6/configure-only-checkoutkit-state June 11, 2026 13:08
@kieran-osgood-shopify kieran-osgood-shopify changed the title Make logger shared state concurrency-safe CheckoutKit UI: @MainActor isolatedMake logger shared state concurrency-safe Jun 12, 2026
@kieran-osgood-shopify kieran-osgood-shopify changed the title CheckoutKit UI: @MainActor isolatedMake logger shared state concurrency-safe CheckoutKit Logger: NSLock guaranteed Jun 12, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from 1d9c9a8 to bf73472 Compare June 12, 2026 12:54
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from db98f08 to 157151b Compare June 12, 2026 12:54
@kieran-osgood-shopify kieran-osgood-shopify changed the title CheckoutKit Logger: NSLock guaranteed Logger: NSLock guaranteed Jun 12, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 157151b to 488079a Compare June 12, 2026 14:11
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from bf73472 to 1b9f6d6 Compare June 12, 2026 14:11
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/swift6/configure-only-checkoutkit-state to graphite-base/86 June 12, 2026 15:21
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 488079a to de784be Compare June 12, 2026 15:22
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from graphite-base/86 to kieran-osgood/swift6/configure-only-checkoutkit-state June 12, 2026 15:22
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from de784be to 329a1a3 Compare June 12, 2026 15:31
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from 1f63d02 to 0d6d8de Compare June 12, 2026 15:40
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 329a1a3 to 88ac844 Compare June 12, 2026 15:40

private func shouldEmit(_ choice: LogLevel) -> Bool {
if logLevel == .none {
let currentLogLevel = logLevel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capturing the loglevel to avoid accessing the lock multiple times or the value changing between accesses

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 88ac844 to 7000043 Compare June 15, 2026 13:17
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch from 0d6d8de to 0e4fa9c Compare June 15, 2026 13:17
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/configure-only-checkoutkit-state branch 2 times, most recently from ec5db8e to d9d261f Compare June 15, 2026 13:34
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 7000043 to 1168aca Compare June 15, 2026 13:34
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/swift6/configure-only-checkoutkit-state to graphite-base/86 June 15, 2026 13:48
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 1168aca to 831d87b Compare June 15, 2026 13:49
@graphite-app graphite-app Bot changed the base branch from graphite-base/86 to main June 15, 2026 13:49
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/swift6/synchronous-logger-state branch from 831d87b to c89f450 Compare June 15, 2026 13:49
@kieran-osgood-shopify kieran-osgood-shopify merged commit 1bf3275 into main Jun 15, 2026
24 checks passed

Copy link
Copy Markdown
Contributor Author

Merge activity

@kieran-osgood-shopify kieran-osgood-shopify deleted the kieran-osgood/swift6/synchronous-logger-state branch June 15, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants