Skip to content
This repository has been archived by the owner on Aug 8, 2021. It is now read-only.

Getting empty strings for content #17

Closed
2 of 3 tasks
SunnyRaj opened this issue May 3, 2021 · 45 comments
Closed
2 of 3 tasks

Getting empty strings for content #17

SunnyRaj opened this issue May 3, 2021 · 45 comments

Comments

@SunnyRaj
Copy link

SunnyRaj commented May 3, 2021

How have you installed gord

  • go get
  • Github Releases
  • git clone & go build .

What happened

The content is being rendered/obtained as an empty string.

Error output

empty content

The history of the messages and the content of any replies are showing fine, the main message/content is empty.

How do you reproduce this bug

Build and Run normally as you would and observe any channel.

System information

Key Value
OS Mac OS
Architecture Darwin/amd64
Terminal MacOS native Terminal
Go version go1.16 darwin/amd64
@awesomehaze
Copy link

I'm getting this too on linux with konsole.

@SunnyRaj
Copy link
Author

SunnyRaj commented May 5, 2021

Tested on Windows using Windows Terminal running Powershell, and have the same problem.

@yellowsink
Copy link
Collaborator

Yep can reproduce on linux with kitty too. Will look into this.

@ghost
Copy link

ghost commented May 5, 2021

reproducible on a tty, universal issue it seems

@yellowsink
Copy link
Collaborator

seems so, gonna start debugging now 👍

@yellowsink
Copy link
Collaborator

i think i have the issue actually: content is "" for some reason. Either the code calling ChatView.AddMessage() is wrong, or this needs a discordgo fork fix

image

@yellowsink
Copy link
Collaborator

Yes, appears to be issue in (my fork of?) discordgo, as the content is missing in the calling method too.

@yellowsink
Copy link
Collaborator

got it!
image

@yellowsink
Copy link
Collaborator

luckily /messages still works so I can use that :)

@yellowsink
Copy link
Collaborator

This has been fixed with a combination of gord-project/discordgo@ec47099 and https://github.com/cainy-a/gord/releases/tag/2021-05-06

It's a hacky fix, but it works well and doesnt add any real slowdown so cool I guess.

Will close once release is built.

@yellowsink
Copy link
Collaborator

OK it's fixed! 🎉 Check the latest release as linked above.

@awesomehaze
Copy link

Awesome!

@ghost
Copy link

ghost commented May 7, 2021

looks like it's still happening sort of, now messages that were just sent render fine, but when I go into a channel, all messages sent while i wasn't in the channel (and sent after I opened gord) don't render, the rest do, but when the channel's open they all render fine

@ouwou
Copy link

ouwou commented May 12, 2021

i suspect if you omit the intents field completely when identifying with a user token this would be fixed

@awesomehaze
Copy link

I'm getting this issue again on the newest version.

@yellowsink
Copy link
Collaborator

Aw crap

@yellowsink yellowsink reopened this May 26, 2021
@awesomehaze
Copy link

Confirmed that it happens for messages in channels that are not active. Switching to these channels shows messages without content.

@awesomehaze
Copy link

E.g. Channel 1 active, switch to channel 2. Message recieved on channel 1. Notification comes with message content, but switching to channel 1 doesn't show the message content.

@yellowsink
Copy link
Collaborator

Hmm ok maybe it only applies the workaround to get content when rendering not on fetching or something weird like that...

@awesomehaze
Copy link

Hmm ok maybe it only applies the workaround to get content when rendering not on fetching or something weird like that...

Any progress on this yet?

@yellowsink
Copy link
Collaborator

OK I've got the issue. The message object is fetched when the message is received, but it should be fetched on render - once you are in the correct channel.

Either that or my ChannelMessage function is broken.

@yellowsink
Copy link
Collaborator

ok yes the function in restapi.go in discordgo is dumb, I will fix ASAP.

@ghost
Copy link

ghost commented Jun 16, 2021

just use assembly idiot lol

@yellowsink
Copy link
Collaborator

my bad lmao

@yellowsink
Copy link
Collaborator

ok turns out it was already fixed at discordgo master, i just forgot to tag it :\

@yellowsink
Copy link
Collaborator

ok it no longer errors but content is empty. Progress but still not ideal.

@yellowsink
Copy link
Collaborator

I defos have the content so thats odd
image

@yellowsink
Copy link
Collaborator

AWW YEAH FIXED IT

@yellowsink
Copy link
Collaborator

Now to make sure it works with caching

@yellowsink
Copy link
Collaborator

and it does POG

@yellowsink
Copy link
Collaborator

I can't believe that like 4 lines fixed that.

@yellowsink
Copy link
Collaborator

yellowsink commented Jun 16, 2021

Here we go https://github.com/yellowsink/gord/releases/2021-06-16 epic

@dromer
Copy link

dromer commented Jun 16, 2021

Nice! this was really starting to annoy me :P
(typically would close/reopen every time I saw new messages on a channel)

@yellowsink
Copy link
Collaborator

Yeah its nice to get such a problematic bug done with so i can focus on features (im thinking images :p )

@dromer
Copy link

dromer commented Jun 16, 2021

Yeah its nice to get such a problematic bug done with so i can focus on features (im thinking images :p )

Lack of #21 is starting to bug me :P

@awesomehaze
Copy link

Yay!

@ghost
Copy link

ghost commented Jul 7, 2021

ok uh whenever a reaction is added to a message that didn't already have any reactions this happens now

@yellowsink
Copy link
Collaborator

Huh that's odd. As in messages in the focused then unfocused state this originally occurred in? Or all messages?

@awesomehaze
Copy link

It's pretty random, but usually unfocused messages. It's still better than it was before

@yellowsink
Copy link
Collaborator

Hmm okay

@ghost
Copy link

ghost commented Jul 8, 2021

Uh i only noticed it where a message that just had its first reaction added to it disappears

@yellowsink
Copy link
Collaborator

right... this sounds like itll be really specific if its this weird

@ghost
Copy link

ghost commented Jul 14, 2021

ok even weirder, when you're in a channel, and then go to the guild selection box with Alt+S, then select a guild, but don't select a channel, then go back and select the same guild and channel you were in before, all messages that were not sent by you, and were sent after gord was opened, disappear

I have literally no clue why this specific scenario causes that, this is incredibly odd

@yellowsink
Copy link
Collaborator

What the...

@yellowsink
Copy link
Collaborator

OK that's weird

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants