-
Notifications
You must be signed in to change notification settings - Fork 71
DROID-4127 Tech | Cross-space chat storage functionality #2893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements cross-space chat storage functionality by adding support for subscribing to objects across multiple user spaces. The implementation introduces new middleware APIs and domain layer containers specifically designed for managing cross-space subscriptions, with a focus on chat objects.
Key changes:
- New middleware methods
objectCrossSpaceSubscribeandobjectCrossSpaceUnsubscribefor cross-space search operations CrossSpaceSubscriptionContainerfor managing storeless subscriptions across all spacesChatsSubscriptionContainerfor maintaining a global subscription to chat objects
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| MiddlewareServiceImplementation.kt | Adds cross-space subscribe/unsubscribe method implementations with error handling |
| MiddlewareService.kt | Defines interface methods for cross-space subscription operations |
| Middleware.kt | Implements cross-space search subscription logic with validation |
| BlockMiddleware.kt | Delegates cross-space subscription calls to middleware |
| StoreSearchParams.kt | Adds CrossSpaceSearchParams data class for cross-space search parameters |
| CrossSpaceSubscriptionContainer.kt | Implements storeless subscription container for cross-space searches |
| ChatsSubscriptionContainer.kt | Implements container for managing global chat subscriptions |
| BlockRepository.kt | Adds interface methods for cross-space subscription operations |
| BlockRemote.kt | Adds remote interface methods for cross-space operations |
| BlockDataRepository.kt | Implements repository delegation for cross-space subscriptions |
| Command.kt | Adds CrossSpaceSearchSubscribe command and removes unused import |
| SubscriptionsModule.kt | Configures DI for CrossSpaceSubscriptionContainer and ChatsSubscriptionContainer |
| VaultDI.kt | Adds ChatsSubscriptionContainer dependency |
Comments suppressed due to low confidence (1)
middleware/src/main/java/com/anytypeio/anytype/middleware/interactor/Middleware.kt:1128
- The
objectSearchSubscribemethod is missing theisValidObject()validation that was added toobjectCrossSpaceSearchSubscribe(lines 1402 and 1408). For consistency, both methods should perform the same validation checks. Consider adding&& record.isValidObject()to the conditions on lines 1369 and 1375, similar to how it's done in the new cross-space method.
results = response.records.mapNotNull { record ->
if (record != null && record.isNotEmpty())
ObjectWrapper.Basic(record)
else
null
},
dependencies = response.dependencies.mapNotNull { record ->
if (record != null && record.isNotEmpty())
ObjectWrapper.Basic(record)
else
null
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?