launchdarkly / erlang-server-sdk

LaunchDarkly Server-Side SDK for Erlang/Elixir
Other
33 stars 37 forks source link

first_name and last_name fields are only accepted as camelCase #20

Closed quinlanjager closed 4 years ago

quinlanjager commented 4 years ago

Describe the bug The LaunchDarkly erlang SDK notes that first_name and last_name are not custom attributes and are included outside of the custom object when produced by the new_from_map function. However, if the two fields are used, they are stripped by the server.

To reproduce Steps to reproduce the behavior.

I'm running the library in Elixir so these were my steps:

  1. In iex

    :ldclient.identify(%{key: "a-key", first_name: "Billy", last_name: "Bob"})
  2. Check the debugger on LaunchDarkly.

Expected behavior The expected behaviour should be the same as running

:ldclient.identify(%{:key => "a-key", "firstName" => "Billy", "lastName" => "Bob"})

That is the first_name and last_name properties are used to set the reserved attributes on LaunchDarkly.

SDK version 1.0.0-beta2

Language version, developer tools

Elixir 1.9.4 Erlang 21.0

OS/platform

MacOS 10.14.16 Additional context Add any other context about the problem here.

zurab-darkly commented 4 years ago

Thank you for reporting. This definitely appears like a bug. The issue seems to be that we never convert the internal first_name and last_name attribute names to firstName and lastName the LaunchDarkly service expects before sending these events.

zurab-darkly commented 4 years ago

This is now fixed in 1.0.0-beta3 release.