Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Commit 9b4f52e

Browse files
hyochanclaude
andcommitted
fix(ios): clear purchasePayloadById on MainActor to match access pattern
Move purchasePayloadById cleanup from listenerLock to MainActor dispatch, since all other accesses to this collection run on MainActor. This eliminates a potential data race between cleanup (background thread) and MainActor writes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 55f1e7b commit 9b4f52e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ios/HybridRnIap.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,10 @@ class HybridRnIap: HybridRnIapSpec {
10891089
lastPurchaseErrorTimestamp = 0
10901090
deliveredPurchaseEventKeys.removeAll()
10911091
deliveredPurchaseEventOrder.removeAll()
1092-
purchasePayloadById.removeAll()
1092+
}
1093+
// Clear purchasePayloadById on MainActor to match its access pattern
1094+
Task { @MainActor in
1095+
self.purchasePayloadById.removeAll()
10931096
}
10941097
}
10951098

0 commit comments

Comments
 (0)