Skip to content

Merge dev into next-dev - #23

Merged
ps2 merged 8 commits into
next-devfrom
merge-dev-into-next-dev
Oct 22, 2026
Merged

ps2 merged 8 commits into
next-devfrom
merge-dev-into-next-dev

Conversation

@ps2

@ps2 ps2 commented Oct 22, 2026 •

Copy link
Copy Markdown

Merges dev into next-dev so that LoopKit/LoopWorkspace#454 (next-dev → dev) no longer conflicts and drops nothing from dev.

Only Lokalise translation updates and language-list changes come from dev; it merged without conflicts.

Built as part of the whole workspace (LoopWorkspace scheme, iOS Simulator) with every submodule at its merge commit.

Please merge with "Create a merge commit" (not squash or rebase); otherwise the merge history is lost and dev will conflict with next-dev again.

marionbarker and others added 8 commits May 12, 2026 16:14
Updated translations from lokalise on Tue May 12 15:47:31 PDT 2026
Repeatedly toggling a RileyLink switch crashes the app with
"unrecognized selector sent to instance 0x8000000000000000" inside
shouldConnect(to:) -- a garbage pointer being messaged, which is a torn
read rather than a real object (LoopKit/Loop#2462).

autoConnectIDs is documented as isolated to centralQueue and every
mutation honours that: connect and disconnect both wrap in
centralQueue.async. Two public readers did not:

    public var connectingCount: Int {
        return self.autoConnectIDs.count
    }

    public func shouldConnect(to deviceID: String) -> Bool {
        return self.autoConnectIDs.contains(deviceID)
    }

Both are read from the main thread by the UI -- shouldConnect backs the
SwiftUI autoconnect Binding in RileyLinkListDataSource and the table
view data source in RileyLinkDevicesTableViewDataSource, connectingCount
backs the "is anything connecting" checks -- so a toggle mutates the Set
on centralQueue while the UI reads it, and fast toggling widens the
window until a read lands mid-mutation.

Back the property with a Locked<Set<String>> rather than hopping the
readers onto centralQueue: every reader is on the main thread and
centralQueue work calls back to the main thread, so a synchronous hop
from the UI would risk deadlock.

Mutations stay serialised by centralQueue, so the read-modify-write in
insert/remove cannot lose an update. The delegate notification keeps
firing after the value changes, and still does not fire during init.

Affects every RileyLink-based pump manager, since they share this
provider: MinimedKit, OmniKit, and OmnipodKit with Omnipod Classic.
@ps2
ps2 merged commit 1a40a33 into next-dev Oct 22, 2026
@ps2
ps2 deleted the merge-dev-into-next-dev branch October 22, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants