Skip to content

[Bug] Transaction transfer detail always empty on history detail screen #2039

Description

@bhuvan-somisetty

Describe the bug

When a user taps a transaction in the history list and navigates to SpecificTransactionsScreen, the transfer detail section never renders even for transactions that have a valid transferId. The screen loads, but the TransactionDetail card remains empty in every case.

This makes the detail screen almost useless for transfer transactions, since the sender/receiver information, reference number, and transfer metadata are never shown.

Root cause

In SpecificTransactionsViewModel.kt, the getAccountTransfer fetch was commented out during the self-service API migration with the note:

// TODO: below api not there for Self So Commented it
//        transaction.transferId?.let { transferId ->
//            accountRepository.getAccountTransfer(transferId)
//                .onEach { result: DataState<TransferDetail> -> ... }
//                .launchIn(viewModelScope)
//        } ?: run {
//            mutableStateFlow.update { it.copy(viewState = Content(transaction, null)) }
//        }

However, AccountRepositoryImpl.getAccountTransfer() already routes through selfManager.accountTransfersApi:

override fun getAccountTransfer(transferId: Long): Flow<DataState<TransferDetail>> {
    return selfManager.accountTransfersApi
        .getAccountTransfer(transferId.toInt())
        .asDataStateFlow().flowOn(ioDispatcher)
}

The self-service endpoint is available. The comment was added as a precaution during migration but was never revisited after the repository implementation was updated. The result is that STState.ViewState.Content always carries detail = null, and the TransactionDetail composable in SpecificTransactionsScreen is never shown to the user.

Steps to reproduce

  1. Log in with an account that has at least one transfer transaction in its history
  2. Navigate to the History tab
  3. Tap any transaction that shows as a transfer (CREDIT or DEBIT with a counterparty)
  4. Observe: the transfer detail card does not appear on SpecificTransactionsScreen

Expected behavior

The TransactionDetail card should render with the full transfer detail - sender name, receiver name, reference number, and transfer amount fetched via accountRepository.getAccountTransfer(transferId).

Actual behavior

detail is always null. The transfer detail section is never shown regardless of the transaction type.

Environment

  • Platform: Android / iOS (Kotlin Multiplatform)
  • Feature module: feature:history
  • Affected screen: SpecificTransactionsScreen
  • Affected ViewModel: SpecificTransactionsViewModel

Additional context

The UI layer already handles both states correctly - SpecificTransactionsScreen shows the TransactionDetail card when detail != null and skips it when null. No UI changes are needed. This is purely a ViewModel-level oversight from the self-service migration.

The fix is to uncomment and restore the getAccountTransfer flow inside handleTransferDetailReceive, since the backing API is already self-service compliant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions