Skip to content

fix(storage-resize-images): degrade gracefully against a partial env #3138

Description

@cabljac

The extension read process.env directly with fallbacks and degraded gracefully when a variable was missing. The kit's params layer crashes at cold start instead. Only reachable outside a normal CLI deploy (library consumers of the params entry point, emulator runs, hand-rolled .env), since the CLI prompts for every param absent from .env.

Two remaining crash paths:

  • IMAGE_TYPE: ListParam.value() JSON-parses the raw variable, so an unset value throws SyntaxError at cold start, and an extension-style jpeg,webp value is not valid JSON either.
  • FUNCTION_MEMORY: IntParam yields 0 when unset or non-numeric, and normalizeMemory passes that through as an invalid "0" memory option.

Fix in #3002 (approved): configFromEnv returns undefined for an absent IMAGE_TYPE and passes non-JSON input through as a raw string for the resolver's comma-splitting toArray, and the 0 memory sentinel maps to undefined so the 1GiB default applies.

Parity ledger: #2974, storage-resize-images runtime-contract table.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions