mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[gh/gl] Fix review-in-editor not starting (IJPL-186195, IJPL-187199, IJPL-181783)
#IJPL-187199 Fixed #IJPL-186195 Fixed Cause of which is a threading exception on loading `.getContent()` (cherry picked from commit eec980bbaf107e2caa4f08c5150e74b773e0593b) IJ-CR-163488 GitOrigin-RevId: 263439b1b91f620222c5d27739485231164173fd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a96d82325e
commit
b99f825790
@@ -18,7 +18,9 @@ import com.intellij.platform.util.coroutines.childScope
|
||||
import git4idea.changes.GitTextFilePatchWithHistory
|
||||
import git4idea.changes.createVcsChange
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.jetbrains.plugins.github.api.data.GHUser
|
||||
import org.jetbrains.plugins.github.api.data.pullrequest.GHPullRequestReviewThread
|
||||
import org.jetbrains.plugins.github.api.data.pullrequest.isVisible
|
||||
@@ -65,9 +67,9 @@ internal class GHPRReviewFileEditorViewModelImpl(
|
||||
private val diffData: GitTextFilePatchWithHistory,
|
||||
private val threadsVms: GHPRThreadsViewModels,
|
||||
private val discussionsViewOption: StateFlow<DiscussionsViewOption>,
|
||||
private val showDiff: (change: RefComparisonChange, lineIdx: Int?) -> Unit
|
||||
private val showDiff: (change: RefComparisonChange, lineIdx: Int?) -> Unit,
|
||||
) : GHPRReviewFileEditorViewModel {
|
||||
private val cs = parentCs.childScope(javaClass.name)
|
||||
private val cs = parentCs.childScope(javaClass.name, Dispatchers.Default)
|
||||
|
||||
override val iconProvider: GHAvatarIconsProvider = dataContext.avatarIconsProvider
|
||||
override val currentUser: GHUser = dataContext.securityService.currentUser
|
||||
@@ -83,7 +85,8 @@ internal class GHPRReviewFileEditorViewModelImpl(
|
||||
}?.onFailure {
|
||||
LOG.warn("Couldn't load head content for $change", it)
|
||||
}
|
||||
}.stateIn(cs, SharingStarted.Lazily, ComputedResult.loading())
|
||||
}.flowOn(Dispatchers.IO)
|
||||
.stateIn(cs, SharingStarted.Lazily, ComputedResult.loading())
|
||||
|
||||
override val changedRanges: List<Range> = diffData.patch.hunks.withoutContext().toList()
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.jetbrains.plugins.gitlab.api.dto.GitLabUserDTO
|
||||
import org.jetbrains.plugins.gitlab.mergerequest.data.GitLabMergeRequest
|
||||
import org.jetbrains.plugins.gitlab.mergerequest.data.GitLabMergeRequestNewDiscussionPosition
|
||||
@@ -76,7 +77,8 @@ internal class GitLabMergeRequestEditorReviewFileViewModelImpl(
|
||||
}.let {
|
||||
emit(it)
|
||||
}
|
||||
}.stateIn(cs, SharingStarted.Lazily, ComputedResult.loading())
|
||||
}.flowOn(Dispatchers.IO)
|
||||
.stateIn(cs, SharingStarted.Lazily, ComputedResult.loading())
|
||||
|
||||
override val changedRanges: List<Range> = diffData.patch.hunks.withoutContext().toList()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user