Skip to content

Conversation

@yasin-ce
Copy link
Collaborator

Summary

  • Reorganize asset inbox under inbox/asset package
  • Add unified InboxRepository and InboxCacheManager
  • Add InboxMessagesDTO and InboxSearchDTO models
  • Add HasInboxItemsForAddressUseCase for badge indicators
  • Add joint account inbox API service and mappers
  • Add unit tests for inbox repository

Test Plan

  • Verify inbox cache refreshes correctly
  • Verify inbox items are fetched for valid addresses
  • Run inbox-related unit tests

@yasin-ce yasin-ce self-assigned this Jan 20, 2026
@yasin-ce yasin-ce force-pushed the multisig/04-misc-updates branch from 6a84b56 to 8602ae8 Compare January 20, 2026 09:31
@yasin-ce yasin-ce force-pushed the multisig/05-data-models branch from 014714a to c3e316e Compare January 20, 2026 09:32
@yasin-ce yasin-ce force-pushed the multisig/04-misc-updates branch from 8602ae8 to cfd09c6 Compare January 20, 2026 09:47
@yasin-ce yasin-ce force-pushed the multisig/05-data-models branch from c3e316e to 6b1b4d5 Compare January 20, 2026 09:48
- Add inbox data models for joint account notifications
- Add sign request transaction list models
- Add participant signature DTOs
- Implement inbox cache manager for joint accounts
- Add inbox item mappers and transformers
@yasin-ce yasin-ce force-pushed the multisig/04-misc-updates branch from cfd09c6 to 252f8ea Compare January 20, 2026 13:49
@yasin-ce yasin-ce force-pushed the multisig/05-data-models branch from 6b1b4d5 to a997278 Compare January 20, 2026 13:49
Resolve merge conflicts:
- JointAccountRepository: combine new method signatures with inbox methods
- JointAccountRepositoryImpl: add inbox methods with new mapper names
- JointAccountModule: combine inbox service with new mapper imports
- DefaultAccountDetailAccountsItemProcessor: fix import path
- InboxSearchDTOMapper: update to use JointSignRequestMapper
- InboxMessagesDTO: update to use JointAccount and JointSignRequest
- Make data layer classes internal (InboxSearchDTOMapper, InboxApiService, data models)
Rename domain models to follow naming conventions:
- InboxSearchDTO -> InboxSearchInput
- InboxMessagesDTO -> InboxMessages
- AssetInboxDTO -> AssetInbox

Update all references in:
- JointAccountRepository and impl
- InboxRepository and impl
- InboxSearchDTOMapper (method names updated)
- InboxCacheManagerImpl
- HasInboxItemsForAddressUseCase
- InboxUseCases interfaces
- Test files
…dressUseCaseTest

Replace AssetInboxDTO/JointAccountDTO with AssetInbox/JointAccount to match
the actual domain model class names on this branch.
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow

internal class InboxRepositoryImpl : InboxRepository {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a repository, this is in-memory cache. Please check InMemoryCacheProvider.


@Provides
@Singleton
fun provideAssetInboxRepository(inboxRepository: InboxRepository): AssetInboxRepository {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to make this singleton if you pass cache in constructor -which is the one should be singleton-

If you pass in memory cache instead of this repository, then repository is the one needs to be singleton

@Provides
fun provideRefreshInboxCache(
inboxCacheManager: InboxCacheManager
): RefreshInboxCache = RefreshInboxCache { inboxCacheManager.refreshCache() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong usage. This is an implementation of a usecase, it should pass function instead of calling it
RefreshInboxCache(inboxCacheManager::refreshCache)

import com.algorand.wallet.jointaccount.transaction.data.mapper.JointSignRequestMapper
import javax.inject.Inject

internal class InboxSearchDTOMapper @Inject constructor(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets create and interface and remove DTO suffix

Comment on lines 45 to 52
suspend fun getInboxMessages(
deviceId: Long,
inboxSearchInput: InboxSearchInput
): PeraResult<InboxMessages>

suspend fun deleteInboxJointInvitationNotification(
deviceId: Long,
jointAddress: String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two are belong to inbox feature. We should move them to inbox. JointAccount has nothing to do with getting inbox messages and deleting notifications

* multisig/04-misc-updates:
  Fix detekt issues without @Suppress
  Fix pre-existing detekt issues
  Use Go SDK for transaction signing and return signature directly
  fix: Address remaining PR #514 review comments
  fix: Address PR #514 review comments
  fix: Address PR #514 feedback
  docs: Add refactoring restrictions to prevent unwanted changes
- Rename InboxRepository to InboxInMemoryCache using InMemoryCacheProvider
- Remove @singleton from AssetInboxModule where cache is passed in constructor
- Use method references instead of lambdas in DI modules
- Rename InboxSearchDTOMapper to InboxSearchMapper (interface + Impl)
- Move getInboxMessages and deleteNotification from JointAccountRepository to InboxApiRepository
- Add rules to prevent these issues in future
yasin-ce added a commit that referenced this pull request Jan 23, 2026
…-support

* multisig/05-data-models:
  Address PR #515 comments for data models
  Fix detekt issues without @Suppress
  Fix pre-existing detekt issues
  Use Go SDK for transaction signing and return signature directly
  fix: Address remaining PR #514 review comments
  fix: Address PR #514 review comments
  fix: Address PR #514 feedback
  docs: Add refactoring restrictions to prevent unwanted changes
@yasin-ce yasin-ce requested a review from mitsinsar January 23, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants