Skip to content

Custom attributes ignored in create_legacy_context  #212

@Hugo-Hache

Description

@Hugo-Hache

I was having issues pushing custom attributes with legacy format of context. By browsing the source code I found this line that ignores attributes other than :ip, :email, :avatar, :firstName, :lastName, :country.

I'm not sure to understand what "dedicated instance variables" mentions this comment, and so how would the custom attributes would make it to the context sent to the server.

In case other people are facing the same issue, migrating to the new format and putting custom attributes at the root fixed it for me:

client.identify({key: 'key', custom: { customAttribute: 'value' }}) # didn't work

client.identify(LaunchDarkly::LDContext.create({kind: 'user', key: 'key', customAttribute: 'value' })) # works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions