HGL
continuing-cyan
2.8.0: the button downloads do nothing: black window ???
Bonjour how this button make good job
17 Replies
fair-rose•3y ago
Send a screenshot please
continuing-cyanOP•3y ago
it’s that the result in the black window after the button download on wayland or X11

fair-rose•3y ago
can you right-click heroic in your system tray then select Debug? then in the developer tools that appears select console and send another screenshot
continuing-cyanOP•3y ago
voilà i hope thart screenshoot is good

fair-rose•3y ago
Perfect thanks, this seems like a bug
@CommandMC any ideas?
@erck63 you are on latest version, correct?
They are on the latest version
Not sure what went wrong here, seems like somehow a game with no installation info was added to your download manager
Closing Heroic and renaming/moving
~/.config/heroic/store/download-manager.json
should resolve the issue. If this does resolve it, I'd like to have a look at that original file
(if you're using the Flatpak version of Heroic, that path is ~/.var/app/com.heroicgameslauncher.hgl/config/heroic/store/download-manager.json
instead)continuing-cyanOP•3y ago
i rename in ~/.config/heroic/store/download-managerold.json but i don’t move it and the button dowloads of HGL is ok 🥹 😀
i cannot paste download-managerold.json here ??? why
metropolitan-bronze•3y ago
Probably someone forgot to handle undefined again in the frontend
Should be fixed
So somewhere in the frontend a
?
is missingThe error's coming from https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/blob/18a4840b7e5e76926acedef557b6130d0187f724/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx#L81, but a GameInfo's
install
property can't be undefined, so the actual mistake that added the malformed entry is somewhere else. That's why I wanted to have a look at the file, to maybe get a clue (which runner was the game for, when was it added, etc.)
You should be able to upload it to https://paste.debian.net/ instead
Only reason I could think of on why this would happen is that you're using the Flatpak version of Discordmetropolitan-bronze•3y ago
Back to the basic. Even you think something can't be undefined it still can in 1:1000000 time. So always check for undefined like you check for null pointer in C to avoid such things. Even this case might happen never. This is just good coding
Checking why the variable was undefined is another thing
If the type of a variable doesn't include
undefined
, it cannot* be undefined. GameInfo
and GameInfo | undefined
are different things for a reason
* unless someone disables TypeScript's checks by using as
(but even then you get some rudimentary verifications)
like you check for null pointer in CEven though this analogy doesn't make sense, even this isn't a consensus. Take a function like
std::strcpy
for example, and try passing it a nullptr
. You'll get a segfault, since the function assumes that you're passing it valid parametersmetropolitan-bronze•3y ago
It still can be undefined that is the weird thing
Yes and segfault is the same here. The frontend does not render because you try to access a variable that does not exist
And even if the type says it can't be undefined it seems sometimes it is
I already fixed in 2.7.1 such problem where a variable was not checked
And you want to avoid segfault in C at all cost because this forceful quit your program
So you want at all cost to avoid undefined access in typescript frontend, else the page is not rendered
Well yes, types are just a compile-time thing, the actual data a variable holds can be different
The problem here is that something somewhere else is asserting that it can't be undefined, while it obviously can be
metropolitan-bronze•3y ago
Probably reading a json file and map it to a type
Your code part that reads the file is responsible to check that everything was read correctly
But could be something different.
continuing-cyanOP•3y ago
i have make with https://paste.debian.net/1281801 the copie of download-managerold.json because the text is too long for my discord et i use a .deb package.
I believe that is problem with DLCs of the game Midnight gost hunt.
like-gold•3y ago
weird, all the elements in that json file seem to have that data it I didn't miss any
ugh nevermind, I missed the first element haha
fair-rose•2y ago
sz