Skip to content

[Tool #119] Env Variable Parser fails to report duplicate keys #375

Description

@baixiangcpp

Summary

Env Variable Parser does not detect duplicate variable names. It reports no duplicate keys even when the same key appears twice, and its summary counts do not clearly represent the duplicate declaration.

Affected tool: Env Variable Parser
Route: https://byteflow.tools/en/env-parser
Observed during browser acceptance: 2026-08-18

Reproduction

  1. Open the affected route.
  2. Replace the input with:
FOO=oneBAR=okFOO=twoBAZ=three
  1. Parse the variables.
  2. Inspect the variable count, duplicate-key report, and exported values.

Actual output

The page reports:

No duplicate keys detected
4 variables
3 variables parsed successfully

The duplicate FOO declaration is not reported. The input contains four declarations but only three unique variable names.

Expected output

The parser should identify FOO as a duplicate and explain the chosen handling policy, for example:

Duplicate keys detected: FOO
4 declarations, 3 unique variables

If the last declaration wins, the exported value should explicitly be FOO=two; if the first wins, that should be stated. The UI must not claim that no duplicates exist.

Impact

Duplicate environment variables can change application configuration silently. Users may believe the file is safe to export while one declaration overrides another.

Regression coverage

Test unique keys, repeated keys with identical values, repeated keys with different values, empty values, and quoted values. Assert that duplicate diagnostics and declaration/unique counts are accurate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions