Skip to content

Conversation

@konstantiniiv
Copy link
Collaborator

@konstantiniiv konstantiniiv commented Nov 20, 2025


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Copy link
Contributor

Copilot AI left a 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 objectCrossSpaceSubscribe and objectCrossSpaceUnsubscribe for cross-space search operations
  • CrossSpaceSubscriptionContainer for managing storeless subscriptions across all spaces
  • ChatsSubscriptionContainer for 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 objectSearchSubscribe method is missing the isValidObject() validation that was added to objectCrossSpaceSearchSubscribe (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.

@konstantiniiv konstantiniiv changed the title Droid 4127 chats storage DROID-4127 Tech | Cross-space chat storage functionality Nov 20, 2025
@konstantiniiv konstantiniiv merged commit 6f6ea38 into main Nov 20, 2025
3 checks passed
@konstantiniiv konstantiniiv deleted the droid-4127-chats-storage branch November 20, 2025 13:00
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants