[recent files] IJPL-178295 Increase the buffer size to avoid loosing recent files

The limit in the previous implementation affected only the case when there are more than SWITCHER_ELEMENTS_LIMIT opened editor tabs. Files fetched from the editor history or changed files history were not affected by the limit, and this must stay the same in the new implementation

This is a fast fix, but proper fix is going to be delivered soon. It will group files into batches and deliver them altogether -> there will be no partial data losses. Instead, we will be able to drop old requested data and always display only the freshest batch of files which would be consistent with the fallback monolith implementation

GitOrigin-RevId: 70ae325ba6859707319eeb18f6158279304bb640
This commit is contained in:
Nikita Katkov
2025-02-17 16:24:55 +00:00
committed by intellij-monorepo-bot
parent 97e4f47c91
commit 762718eb48
2 changed files with 2 additions and 2 deletions
@@ -21,7 +21,7 @@ import kotlinx.coroutines.flow.*
@Service(Service.Level.PROJECT)
internal class RecentFileEventsPerProjectHolder {
private val recentFiles = MutableSharedFlow<RecentFilesEvent>(
extraBufferCapacity = SWITCHER_ELEMENTS_LIMIT,
extraBufferCapacity = 100,
onBufferOverflow = BufferOverflow.DROP_OLDEST
)
@@ -143,4 +143,4 @@ private fun createRecentFileViewModel(virtualFile: VirtualFile, project: Project
)
}
internal const val SWITCHER_ELEMENTS_LIMIT: Int = 30
private const val SWITCHER_ELEMENTS_LIMIT: Int = 30