User avatar not uploaded
I'm updating the user info passing in a link for the user avatar, but the
avatar
field doesn't show at all in the update response (or get
), and the avatar doesn't display in the UI. Here's part of the code and the outputs from what the input and output data looks like:
Note that the other info is updated successfully. I've also activated the avatar and selected "user avatar" for this workflow in the dashboard.
Am I missing something here?24 Replies
Hi @ninadk, I'm an AI assistant knowledgeable about Novu. While a team member is able to review this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Update subscriber
* General
* iFrame
* Iframe Embed
-----------------------------
Answer
Based on the details provided and the Novu documentation, when updating a subscriber using the Novu API, including the
avatar
field is supported and should reflect in the update response. As seen in the documentation for updating a subscriber, the avatar
field is a string and is part of the expected fields that can be updated. If the avatar
field is not appearing in the update response or the Novu UI as expected, and other information is updated successfully, it might indicate an issue with how the avatar update is processed or displayed by Novu.
Given the circumstances, there are a few steps you can consider:
1. Ensure that the URL for the avatar image is accessible and correctly formatted. The avatar field expects a string, which should be a valid URL to the image.
2. Double-check that the avatar functionality is correctly enabled in your Novu dashboard settings for it to display in the UI.
3. Since the avatar does not display despite being activated in the dashboard, there might be a bug or a specific issue with the Novu system handling avatar updates.
As your situation appears to be specific and does not seem to align with expected behavior according to the documentation, it's recommended to reach out to Novu support or file a bug report. Given that this situation involves expected functionality not performing as documented, Novu's support team or the community might provide further insights or workarounds.
Note: The documentation does not explicitly mention any additional steps required for the avatar to be displayed in the UI after an update. If all steps have been correctly followed on your end, seeking support directly from Novu might be the best course of action to resolve this issue (1) .Got it. Tagging @Support for additional help.
You mean you set user avatar here? @ninadk
Yeap
@ninadk, you just advanced to level 1!
That will add the avatar of the actor, not the current subscriber
https://docs.novu.co/additional-resources/glossary#actor
try adding to the trigger you are executing
let me know how that goes 🙂 @ninadk
This is my code for triggering the notification:
I believe the issue is that the avatar doesn't even get set, though, as shown in the return of the
update
method I pasted above (3rd snippet).@ninadk
could you please share environmentId from settings?
sure 659fb61f76272e378b87e463
@ninadk
Thanks for sharing the environmentId
i can check from logs that you have created subscriber with subscriberId
2
few times and then deleted.
Did you try updating the current subscriber with subscriberId 2
?Yes, I did. This could be because every time I re-seed the database I also delete all subscribers and re-create them.
I just tried again. I can see the other information I'm updating on my subscribers dashboard, but not the avatar.
@ninadk
Could you please try directly with our API?
https://docs.novu.co/api-reference/subscribers/update-subscriber
That worked! I tried it directly on your website. Should I use a fetch instead of the
update
method then?its a bit strange, do you see the similar bahaviour with other subscribers?
Yes I just checked. Though i wasn't able to do the same using a fetch request programmatically:
@ninadk could you please check if
imageUrl
is null
or a valid string
?It is valid.
And the other information is not updated either with the
fetch
.I see we have null condition check
https://github.com/novuhq/novu/blob/next/packages/application-generic/src/usecases/update-subscriber/update-subscriber.usecase.ts#L53
Good to know! It's a valid url though.
Could you help me out re the
fetch
call? Am I doing something wrong there?@ninadk, you just advanced to level 2!
@ninadk can you please try without the stringify of the body?
Still no lack... Here's the updated code:
And what
subscriberInfo
looks like:
The image URL is random.
I tried updating the lastName
this time, but it didn't work.