发布

  • fix(infra): deterministic env var ordering (#4893)

    frostbyte_neo 发布于 2025-03-19 10:38:47 +00:00

    This change sorts environment variables alphabetically before they're
    processed with import-meta-env that injects them into the index.html.
    This makes sure consistent hashes across pod restarts when there aren't
    any functional changes made to the .env file.

    The issue was affecting desktop app reconnections after k8s pod restarts.

    The cause was non-deterministic env var ordering (a sideeffect of Map)
    during the import-meta-env injection process. Even when the env vars
    themselves didn't change, their order in the injected JSON could change,
    ultimately resulting in different file hashes.

    This fix ensures that regardless of the order in which env vars are
    provided by the runtime, they will be sorted alphabetically before being
    written to the build.env file.

    下载附件