getditto / DittoSwiftTools

Diagnostic and Debugging Tools for DittoSwift
MIT License
9 stars 2 forks source link

Swift - tweaks to heartbeat collection subscription (part 1) #114

Closed bplattenburg closed 5 months ago

bplattenburg commented 6 months ago

Today, we automatically subscribe any device using the hearbeat tool to the entire dittotools_devices collection, but that doesn't scale to production across multiple locations.

We either need to provide a way to disable this subscription (which has the downside of breaking multihop for a device which can't see the big peer e.g. lost LAN but still has BLE) or provide the ability to scope it to a more limited query like "devices at the same locationId as this device"

Note - we should also pair any limited query here with a matching eviction query to cover devices changing location and other edge cases

bplattenburg commented 5 months ago

In the short term, the path forward here is to use publishToDittoCollection in the heartbeat config to control whether to subscribe to the collection.

Longer term, I'll break out a story (link to be added here) to narrow the subscription to something like "devices in the same location" to allow for flooding & multihop to get data out without pulling data in from remote devices

bplattenburg commented 5 months ago

Part 2 (location-specific subscriptions) broken out into #121