BlueHuskyStudios / BlueHuskyStudios/DeadassSimpleMediaPlayer
`@Observable` + `@unchecked Sendable` on `AsyncMetadata` races more than the comment admits
- Dominant language
- Swift
- Stars
- 0
- Forks
- 3
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 9
Description
The class comment acknowledges a benign race on the `__cache` dictionary insert. But `@Observable` rewrites every stored property — including `__cache` — into accessors that touch an `ObservationRegistrar`. Concurrent mutation therefore races the registrar's own internal state, not just the dictionary.
Two concurrent first-lookups producing a wasted `Task` is benign; two concurrent registrar mutations are not the same category of risk.
Note also that `@Observable` is applied only under `#if swift(>=6)`, so the iOS 16 target has different reactivity semantics from the modern one.
Contributor guide
Research direction
Start by locating AsyncMetadata and inspect how @Observable is applied under the Swift 6 conditional, including the iOS 16 path. Compare the concurrent cache lookup and ObservationRegistrar behavior in both configurations; done requires an explicit resolution of the registrar race and the differing reactivity semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100