mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Fixes an issue where if a characteristic is created and then updated with a non-nil value, and a new characteristic under the same service is added, then when the service is re-added the old characteristic will be permanently cached and the dynamic reads will stop working. This also eliminates the issue when characteristics are created concurrently, since service additions are batched, if the service addition fails then only one of the characteristics will know that it failed to get added. This change also introduces the nuance of "success" does not mean the CoreBluetooth method has completed successfully, but instead means that the intended state has been recorded and the class will do its best to maintain that state. For example, a successful "start advertising" call means that we have the advertisement cached and we will start advertising as soon as we can (like BT transitions from off to on) and will do our best to keep advertising (like BT transitions from on to off to on again). PiperOrigin-RevId: 551660634