spandex-project/spandex_datadog

Upgrade to `msgpax` 2

Closed this issue · 1 comments

On recent versions of Elixir / OTP, we are seeing errors like this, which appear to be related to msgpax. Since it's pinned a major version behind, we should try upgrading it, but I think that there is a breaking change in 2.0 around encoding KeywordLists that will need to be handled during that upgrade.

I will try to look more into this, but wanted to get an issue open so we don't lose track.

warning: the Collectable protocol is deprecated for non-empty lists. The behaviour of things like Enum.into/2 or "for" comprehensions with an :into option is incorrect when collecting into non-empty lists. If you're collecting into a non-empty keyword list, consider using Keyword.merge/2 instead. If you're collecting into a non-empty list, consider concatenating the two lists with the ++ operator.
  (elixir) lib/collectable.ex:83: Collectable.List.into/1
  (msgpax) lib/msgpax/packer.ex:128: Msgpax.Packer.Map.pack/1
  (msgpax) lib/msgpax/packer.ex:129: anonymous fn/3 in Msgpax.Packer.Map.pack/1
  (stdlib) lists.erl:1263: :lists.foldl/3
  (msgpax) lib/msgpax/packer.ex:128: Msgpax.Packer.Map.pack/1
  (msgpax) lib/msgpax/packer.ex:152: anonymous fn/3 in Msgpax.Packer.List.pack/1
  (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
  (msgpax) lib/msgpax/packer.ex:151: Msgpax.Packer.List.pack/1
  (msgpax) lib/msgpax/packer.ex:152: anonymous fn/3 in Msgpax.Packer.List.pack/1
  (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
  (msgpax) lib/msgpax/packer.ex:151: Msgpax.Packer.List.pack/1
  (msgpax) lib/msgpax.ex:85: Msgpax.pack/2
  (msgpax) lib/msgpax.ex:122: Msgpax.pack!/2
  (spandex_datadog) lib/spandex_datadog/api_server.ex:192: SpandexDatadog.ApiServer.send_and_log/2
  (spandex_datadog) lib/spandex_datadog/api_server.ex:169: anonymous fn/3 in SpandexDatadog.ApiServer.handle_call/3
  (elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
  (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Ah whoops, never mind. This is already solved by #12. Upgrading to latest spandex_datadog solves it. 👍