Skip to content

Why cache namespaces? #974

@OldStarchy

Description

@OldStarchy

I do not understand why localstorage is used to cache the enabled namespaces. It seems to just cause confusion with unexpected behavior. #901 #536 #871 #534 #337

I had to spend some time to figure out why

if (process.env.VITE_DEBUG_ENABLE)
    debug.enable(process.env.VITE_DEBUG_ENABLE);

didn't work when I removed the env var. I expected each page load to be an isolated environment until I managed to step through the code and see its caching. I tried to disable storage with debug.store = null but that didn't prevent the initial load.

debug.enable(process.env.VITE_DEBUG_ENABLE ?? '');

is where I landed, which admittedly isn't complicated, but its weird that I had to deal with this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions