UDF object/associate array arguments are not represented/exported properly (for Paginate?)

Hi folks. If you define a UDF that uses associative array arguments…

Query(
  Lambda(
    ["match", "size", "after", "before"],
    If(
      Equals(Var("before"), null),
      If(
        Equals(Var("after"), null),
        Paginate(Var("match"), {size: Var("size")}),
        Paginate(Var("match"), {after: Var("after"), size: Var("size")})
      ),
      Paginate(Var("match"), {before: Var("before"), size: Var("size")})
    )
  )

then when you Get() that function, it turns into this.

Query(
  Lambda(
    ["match", "size", "after", "before"],
    If(
      Equals(Var("before"), null),
      If(
        Equals(Var("after"), null),
        Paginate(Var("match"), Var("size")),
        Paginate(Var("match"), Var("after"), Var("size"))
      ),
      Paginate(Var("match"), Var("before"), Var("size"))
    )
  )
)

Then if you try to recreate that function elsewhere on the basis of the data dump, or even try to edit it in the dashboard, you get a broken function until you reintroduce the keys.

I’ve only seen this in Paginate so far.

This is a known issue and the fix will be available in next release.

1 Like