🐛 Fixed an issue where after a device applies for a new IP address, it is not synchronized to other devices#2715
Merged
guiyanakuang merged 2 commits intomainfrom May 9, 2025
Conversation
…t is not synchronized to other devices
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a synchronization bug where a device’s newly applied IP address wasn't properly propagated to other devices. Key changes include updating API calls from update to updateSyncRuntimeInfo, converting several methods to suspend functions, and modifying the refresh behavior in the GeneralNearbyDeviceManager.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| DesktopCrossPasteModule.kt | Updated instantiation of GeneralNearbyDeviceManager to remove an extraneous dependency |
| DeviceDetailContentView.kt | Revised calls to use updateSyncRuntimeInfo instead of update |
| SyncHandler.kt & MarketingSyncHandler.kt | Renamed update methods to updateSyncRuntimeInfo for consistency |
| MarketingNearbyDeviceManager.kt & GeneralNearbyDeviceManager.kt | Changed device management methods (add, remove, refresh) to suspend functions and adjusted refresh logic |
Comments suppressed due to low confidence (3)
app/src/commonMain/kotlin/com/crosspaste/sync/GeneralSyncHandler.kt:204
- [nitpick] The private 'update' function called here shares a similar name to the public 'updateSyncRuntimeInfo' and might be confusing. Consider renaming the private helper (e.g., to 'performUpdate') to better differentiate its purpose.
return mutex.withLock { update { doUpdate(it) } }
app/src/commonMain/kotlin/com/crosspaste/sync/GeneralNearbyDeviceManager.kt:64
- [nitpick] The revised refresh logic iterates over syncRuntimeInfos and calls updateSyncRuntimeInfo individually; consider whether a batched update might reduce overhead when processing many devices.
for (syncRuntimeInfo in existSyncRuntimeInfos) { ... }
app/src/desktopMain/kotlin/com/crosspaste/DesktopCrossPasteModule.kt:303
- Ensure that the removal of the extra dependency is intentional and that the new constructor signature of GeneralNearbyDeviceManager fully supports all required functionality.
GeneralNearbyDeviceManager(get(), get(), get(), get())
…t is not synchronized to other devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #2714