Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Stale metadata in the cache #70

Description

@mdrlzy

Right now we are not removing lost resource meta, which causes npe:

06-09 00:56:01.152 E/ACRA    (16329): ACRA caught a NullPointerException for space.taran.arknavigator
06-09 00:56:01.152 E/ACRA    (16329): java.lang.NullPointerException
06-09 00:56:01.152 E/ACRA    (16329): 	at space.taran.arklib.domain.preview.RootPreviewProcessor.initKnownResources(RootPreviewProcessor.kt:128)
06-09 00:56:01.152 E/ACRA    (16329): 	at space.taran.arklib.domain.preview.RootPreviewProcessor.access$initKnownResources(RootPreviewProcessor.kt:15)
06-09 00:56:01.152 E/ACRA    (16329): 	at space.taran.arklib.domain.preview.RootPreviewProcessor$init$2.invokeSuspend(RootPreviewProcessor.kt:44)
06-09 00:56:01.152 E/ACRA    (16329): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
06-09 00:56:01.152 E/ACRA    (16329): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
06-09 00:56:01.152 E/ACRA    (16329): 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
06-09 00:56:01.152 E/ACRA    (16329): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
06-09 00:56:01.152 E/ACRA    (16329): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
06-09 00:56:01.152 E/ACRA    (16329): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
06-09 00:56:01.152 E/ACRA    (16329): 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@a414215, Dispatchers.Default]
    private suspend fun initKnownResources() {
        _busy.emit(true)
        metadata.state().forEach { (id, meta) ->
            val path = index.getPath(id)!!
            generate(id, path, meta)
        }
    ...
    }

RootPreviewProcessor takes meta, but there is no such id in index, because resource was deleted, but meta was not deleted
See ARK-Builders/arklib#40

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions