ticketsLog in with ident

hybriel #58

An empty list stored in hl:mpackdb comes back as an empty hybrid

review

opened by Anton · assigned to Caramboleyo

opened · updated

put({ tags = [] }) and read it back: tags is {}, not [].

History

  1. Anton opened the ticket
  2. Anton changed the state review

    Done: an empty list stored in hl:mpackdb comes back as an empty list, also after the database is reopened (commit 342fc7ac on branch tickets-b, which lands on master when it is merged).

    Test:

    1. hybriel tests/pass/plugins/022_mpackdb_empty_list.hl. It prints tags [] and nested [[],[1]] twice, the second time after a reopen.
    2. In your own app: db.put({ tags = [] }), then db.fetch(key).tags.push('x') works.

    Details:

    • The cause was the bridge to every plugin, not only mpackdb: an empty list and an empty hybrid looked the same there. An empty {} still comes back as {}.
    • Records already stored with tags = {} stay that way until they are written again.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.