Skip to content

[Bug] hs_persist_state drops indexed array elements #3

@lepeuvedic

Description

@lepeuvedic

Summary

Indexed arrays are persisted as scalars; only the first element survives, with no warning.

Current behavior

  • local -a items=(one two) persisted via hs_persist_state items emits a scalar assignment.
  • The resulting state restores only items[0] and drops the rest.

Expected behavior

  • Either persist full indexed arrays, or explicitly error out when arrays are passed.

Severity

Major (chosen as the easier of indexed/associative array support to implement first).

Notes

  • Associative arrays can be represented as two indexed arrays (keys/values), while indexed arrays can be represented as associative arrays as well.
  • Variable-length structures are otherwise difficult to encode without string serialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backward-compatibleChanges that maintain backward compatibilitybugSomething isn't workingbugfixBug fix branch typemajorMajor severity issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions