ble-reticulum/src/ble_reticulum
torlando-tech 46299f3147 fix: add identity cache to prevent data loss on reconnection
When Python's disconnect callback fires but the driver layer (Android/Kotlin)
maintains or quickly re-establishes the GATT connection, data was being
dropped because address_to_identity was cleared.

Changes:
- Add _identity_cache with 60-second TTL to preserve identities after disconnect
- Cache identity in _device_disconnected_callback before cleanup
- Check cache in _handle_ble_data and restore identity if found
- Add on_address_changed callback for dual connection deduplication
- Add _address_changed_callback to migrate identity mappings
- Support driver.request_identity_resync() for fallback recovery

This fixes the "no identity for peer X, dropping data" warning that occurred
when the Python layer lost track of a peer that was still connected at the
driver level.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 12:38:08 -05:00
..
__init__.py refactor: rename package from RNS.Interfaces to ble_reticulum 2025-12-29 23:30:07 -05:00
BLEAgent.py refactor: rename package from RNS.Interfaces to ble_reticulum 2025-12-29 23:30:07 -05:00
BLEFragmentation.py refactor: rename package from RNS.Interfaces to ble_reticulum 2025-12-29 23:30:07 -05:00
BLEGATTServer.py refactor: rename package from RNS.Interfaces to ble_reticulum 2025-12-29 23:30:07 -05:00
BLEInterface.py fix: add identity cache to prevent data loss on reconnection 2025-12-30 12:38:08 -05:00
bluetooth_driver.py fix: add identity cache to prevent data loss on reconnection 2025-12-30 12:38:08 -05:00
linux_bluetooth_driver.py refactor: rename package from RNS.Interfaces to ble_reticulum 2025-12-29 23:30:07 -05:00