Skip to content

Commit

Permalink
Merge pull request #1023 from radixdlt/task/revert-priorioty-queue-fo…
Browse files Browse the repository at this point in the history
…r-mobile-requests

Disable priority queue for mobile requests
  • Loading branch information
micbakos-rdx authored Jul 1, 2024
2 parents a417566 + c48af5a commit dedb23a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class IncomingRequestRepositoryImpl @Inject constructor(
// Put high priority item below any internal request and mobile connect requests
val index = requestQueue.indexOfFirst {
val item = it as? QueueItem.RequestItem
item != null && !item.incomingRequest.isInternal && !item.incomingRequest.isMobileConnectRequest
item != null && !item.incomingRequest.isInternal
}
if (index != -1) {
requestQueue.add(index, QueueItem.HighPriorityScreen)
Expand Down Expand Up @@ -179,6 +179,7 @@ class IncomingRequestRepositoryImpl @Inject constructor(
if (queueItem == null) {
Timber.w("Request with id $requestId is null")
}
Timber.d("\uD83D\uDDC2 get request $requestId")
return (queueItem as? QueueItem.RequestItem)?.incomingRequest
}

Expand All @@ -194,7 +195,6 @@ class IncomingRequestRepositoryImpl @Inject constructor(
// In order to emit an incoming request, the topmost item should be
// a. An incoming request
// b. It should not be the same as the one being handled already
Timber.d("Next request id ${(nextRequest as? QueueItem.RequestItem)?.incomingRequest?.interactionId}")
if (nextRequest is QueueItem.RequestItem && _currentRequestToHandle.value != nextRequest.incomingRequest) {
_currentRequestToHandle.emit(nextRequest.incomingRequest)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,12 @@ class MainViewModel @Inject constructor(
verifyingDappRequestJob = viewModelScope.launch {
verifyDappUseCase(request).onSuccess { verified ->
if (verified) {
if (request.isMobileConnectRequest) {
incomingRequestRepository.addPriorityRequest(request)
} else {
incomingRequestRepository.add(request)
}
// TODO temporarily disabled for the 1.7.0 release. This will be included in the next release.
// if (request.isMobileConnectRequest) {
// incomingRequestRepository.addPriorityRequest(request)
// } else {
incomingRequestRepository.add(request)
// }
}
}.onFailure { error ->
if (error is RadixWalletException.DappRequestException) {
Expand Down

0 comments on commit dedb23a

Please sign in to comment.