Skip to content

If metadata contains userId property, value passed for userId prop is ignored #15

@bflemi3

Description

@bflemi3

Version: 1.2.1

Problem

Even though I'm passing profile.email as the userId prop, when I go to the Feedback Fish dashboard the userId field for the feedback is showing as profile.userId and I don't have the option to "Reply with Mail".

<FeedbackFish 
  projectId={process.env.REACT_APP_FEEDBACK_FISH_PROJECT as string} 
  userId={profile.email}
  metadata={profile}
>
...
</FeedbackFish>

Here's the profile I'm sending as metadata. Some fields removed or redacted...

{
  avatar: ""
  displayName: "REDACTED"
  email: "dev@REDACTED"
  isSuperAdmin: true
  products: [REDACTED]
  subject: "REDACTED"
  userId: 17
}

Expected Behavior

Since the documentation says to pass the email address of the user, I would expect that no matter what I pass in the metadata, the value I assign to the userId prop would be respected (maybe even validated to be an email - a warning could be displayed in the console in development mode). Especially with the "Reply with Mail" feature seeming to hinge on the value of the userId prop being an email address.

It may even make sense to change the userId prop to email to be more clear what you're asking for.

Actual Behavior

The value of the userId field shown in the Feedback Fish shows 17, which is the value of profile.userId passed in metadata. Furthermore, the "Reply with Mail" button is not displayed in the Feedback Fish dashboard.

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