-
-
Notifications
You must be signed in to change notification settings - Fork 82
Refactor: Extract SyncResolverApi interface and SyncDeviceManager class #3942
Copy link
Copy link
Closed
Description
Background
SyncResolver mixes two concerns:
- Complex connection resolution logic (telnet, heartbeat, token verification)
- Simple device management delegates (DAO calls, API notifications)
It also has no interface, making it harder to mock and violating dependency inversion.
Changes
Extract SyncResolverApi interface
- New interface with a single
emitEvent(event: SyncEvent)method SyncResolverimplements the interfaceGeneralSyncManagerand Koin bindings depend on the interface
Extract SyncDeviceManager class
Move 7 device management methods into a focused class with only 3 dependencies:
updateAllowSend,updateAllowReceive,updateNoteNameshowToken,notifyExit,markExit,removeDevice
Split tests
- Move 11 device management tests from
SyncResolverTesttoSyncDeviceManagerTest SyncDeviceManagerTestmocks only 3 deps instead of 10+
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels