EDIT: actual bug reveiled here (drum-roll…): Social.discord.share silently fails when message include newline characters (\r\n) - #20 by Colorfulstan
Updated description
Issue Description:
Trying to user the API to share an url to discord on the user behalf.
reproduction:
overwolf.social.discord.share({
channelId:channel.id,
message: 'Check out this Highlight, \r\n' + url
}, ()=>{})
Api will not be able to share this message to discord, but the API call results in a success.
Hi, and thanks for the feedback.
I understand that it does not interfere with your development progress.
We will check the issue, and we will update you here.
Thanks.
Hey, @Colorfulstan.
I tried to reproduce without success: when I used an invalid file path, I was getting this error:
{success: false, error: "MissingFile"}
When using a valid file, it worked as expected.
This is the working code that I used:
let settingsLocalFile=
{
"file":"C:\\Users\\eransharv\\Videos\\Overwolf\\test.mp4",
"message":"Check out my video! #LeagueofLegends | Captured by #Overwolf",
"events":[
"death"
],
"gameClassId":5426,
"gameTitle":"League of Legends",
"channelId":"544173576018722867",
"metadata":{
"champion":"Urgot",
"win":"Win"
}
}
overwolf.social.discord.share(settingsLocalFile, console.log)
And of course that I changed the file path to be invalid for the reproduction. (used URL param).
Thanks.
Try to use a remote url to a video file, that’s what I did, not the overwolf file url fornat but http://something
@Colorfulstan to clarify - this is precisely what I’ve tried to do. And still - got that error.
Have you wanted to test it with another app?
Why would I test with another app?
It worked, then I tried what I described and now I can’t get it to work anymore, using the bare API.
What do you need from me to debug it?
Is there any relevant logs?
I restarted my PC and still, only get the error notification.
At the same time, the API tells me a “success” status, so we can’t even inform in the app if it happens.
so can I remove my logs folder from the original post if it’s not doing anything for you?
About the logs: I thought you remove the logs once you got them, I actually don’t want my logs folder to be publicly accessible and removing it now
done from developer console
@Colorfulstan you can send me the logs through the private messages here or use slack
Thanks.
Hey, @Colorfulstan.
Currently, I can’t reproduce it. I’m still analyzing the logs. And I’ll update you with the results.
Thanks.
Hey @Colorfulstan,
We couldn’t find anything that looks relevant in our logs.
Can you please try to reproduce the issue on another machine? (preferably equipped with updated win 10 OS).
Thanks
I figured it out.
When you add \r\n to the message string, it breaks. But as mentioned above, it breaks silently (the app / callback of overwolf.social.discord.share implies it worked)
Works fine without them.
So potential bugs here would be imo:
- newline characters break discord sharing
- invalid message error is not propagated to the app
Interestingly enough: Using a template string works and correctly formats the message on the discord receiver
overwolf.social.discord.share({
"message":`
Check out my video! #LeagueofLegends | Captured by #Overwolf
some
` ,
"channelId": "510412375569203212",
}, console.log)
@Colorfulstan hey,
I was able to reproduce the issue with the /r/n. Nice catch!
I will create a bug for the R&D.
Thanks!