Skip to content

Adding to Steam can fail due to error checking that isn't required #2030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Zarklord opened this issue Nov 19, 2022 · 13 comments · Fixed by #2357
Closed

Adding to Steam can fail due to error checking that isn't required #2030

Zarklord opened this issue Nov 19, 2022 · 13 comments · Fixed by #2357

Comments

@Zarklord
Copy link
Contributor

Describe the bug

Trying to add games to steam throws this error in the log
(12:20:30) ERROR: [Shortcuts]: Can't remove "Goat Simulator 3" from Steam user "<redacted>". "C:\Program Files (x86)\Steam\userdata\<redacted>\config\shortcuts.vdf" is corrupted!

One of the game entries is missing the AppName parameter!

the thing is, my shortcuts.vdf isn't corrupt, it just contained an entry like this:

	{
		"appid" "-1493849556"
		"appName" "Dolphin Emulator"
		"exe" "\"E:\\NintendoEmulation\\SteamDolphin\\Dolphin.exe\""
		"StartDir" "E:\\NintendoEmulation\\SteamDolphin\\"
		"icon" "E:\\NintendoEmulation\\Tools\\Dolphin icon.png"
		"ShortcutPath" ""
		"LaunchOptions" ""
		"IsHidden" "0"
		"AllowDesktopConfig" "1"
		"AllowOverlay" "1"
		"OpenVR" "0"
		"Devkit" "0"
		"DevkitGameID" ""
		"DevkitOverrideAppID" "0"
		"LastPlayTime" "1666485127"
		"FlatpakAppID" ""
		"tags"
		{
			"0" "favorite"
			"1" "Emulators"
		}
	}

Notice how it has appName, but not AppName or appname, this is due to the error checking not properly checking case insensitivity.
This shortcut does work on steam, so the error checking is at fault here.

IMO, its not really on this program to check for valid VDF entries, it should just add the entry, and possibly warn the user that the shortcuts file is potentially corrupt, and so they might need to go delete the file.

Add logs

(12:20:31) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:32) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:33) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:33) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:34) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:35) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:35) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:36) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:36) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:37) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:37) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:38) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:39) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:39) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:40) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:41) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:41) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:42) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:42) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:43) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:44) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:44) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:45) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:45) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:46) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:47) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:47) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:48) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:48) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:49) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:50) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:50) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:51) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:51) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:52) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:53) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:53) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:54) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:55) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:55) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:56) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:56) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:57) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:58) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:58) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:59) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:20:59) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:00) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:00) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:01) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:02) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:02) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:03) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:04) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:04) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:05) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:05) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:06) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:07) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:07) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:08) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:08) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:09) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:10) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:10) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:11) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:12) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:12) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:13) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:14) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:14) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:15) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:15) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:16) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:17) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:17) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:18) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:18) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:19) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:20) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:20) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:21) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:21) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:22) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:23) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:23) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:24) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:24) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:25) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:26) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:26) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:27) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:28) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:28) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:29) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:29) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:30) INFO: [Shortcuts]: Prepare Steam images for Goat Simulator 3
(12:21:31) WARNING: [Shortcuts]: Goat Simulator 3 could not be added to all found Steam users.
(12:21:31) ERROR: [Shortcuts]: Can't add "Goat Simulator 3" to Steam user "". "C:\Program Files (x86)\Steam\userdata<steamuserid>\config\shortcuts.vdf" is corrupted!
One of the game entries is missing the AppName parameter!
One of the game entries is missing the AppName parameter!
One of the game entries is missing the AppName parameter!
One of the game entries is missing the AppName parameter!

Steps to reproduce

Add to steam with a "corrupted" shortcuts.vdf

Expected behavior

It should add to my shortcuts.vdf

Screenshots

No response

System Information

Windows 11

Additional information

No response

@rodrigovda
Copy link

rodrigovda commented Jan 16, 2023

I can confirm this issue happens in Windows, since for some reason Steam saves the AppName parameter written as "appName" (lowercase a).

The only workaround is manually editing the "shortcuts.vdf" file by replacing "appName" with "AppName" EVERY TIME before adding a game.

My programming skills are limited, but I found out that in the file:
src/backend/shortcuts/nonesteamgame/nonesteamgame.ts

there is a check in line 172 that tries to make a case insensitive comparison using "toLowerCase", but it somehow fails, maybe the "entry" object stores entries not "Lowercased":

if (!(key in entry) && !(key.toLowerCase() in entry)) {
checkResult.errors.push(
`One of the game entries is missing the ${key} parameter!`
)
checkResult.success = false
}

entry is stablished earlier at:
object.shortcuts.forEach((entry) => {

Where:

Soit seems to me that the fix would either consist on lowercasing the entry object in line 172 when making the comparison, or lowercasing the "appname" field in the Partial<ShortcutObject>, but as I said, my programming skills are limited.

Someone that is more knowledgeable than me should take a look at it, seems like this could be a quick fix that would hugely improve usage of the Heroic Games Launcher

@Nocccer
Copy link
Collaborator

Nocccer commented Jan 16, 2023

I can confirm this issue happens in Windows, since for some reason Steam saves the AppName parameter written as "appName" (lowercase a).

The only workaround is manually editing the "shortcuts.vdf" file by replacing "appName" with "AppName" EVERY TIME before adding a game.

My programming skills are limited, but I found out that in the file:
src/backend/shortcuts/nonesteamgame/nonesteamgame.ts

there is a check in line 172 that tries to make a case insensitive comparison using "toLowerCase", but it somehow fails, maybe the "entry" object stores entries not "Lowercased":

if (!(key in entry) && !(key.toLowerCase() in entry)) {
checkResult.errors.push(
`One of the game entries is missing the ${key} parameter!`
)
checkResult.success = false
}

entry is stablished earlier at:
object.shortcuts.forEach((entry) => {

Where:

Soit seems to me that the fix would either consist on lowercasing the entry object in line 172 when making the comparison, or lowercasing the "appname" field in the Partial<ShortcutObject>, but as I said, my programming skills are limited.

Someone that is more knowledgeable than me should take a look at it, seems like this could be a quick fix that would hugely improve usage of the Heroic Games Launcher

Please provide your shortcuts.vdf so i can might can fix that and update our tests.

The fix would be to check for AppName, appname and now for appName. I would asume another third party tool adds the appName. Had no problem on steam deck with heroic and manually added games.

@Zarklord
Copy link
Contributor Author

Please provide your shortcuts.vdf so i can might can fix that and update our tests.

The fix would be to check for AppName, appname and now for appName. I would asume another third party tool adds the appName. Had no problem on steam deck with heroic and manually added games.

The fix is to not test it at all, if another entry is (potentially) broken that's not relevant to adding new entry.
Even still, steam itself adds entries with appName, maybe not on linux, but on windows mine got appName when adding custom shortcuts through steams UI.
The thing is if shortcuts.vdf is truly corrupted, steam will tell you, we don't need a 3rd party tool that at best can match steam's error checking, and most of the time will be behind steam's error checking, and will falsely report corruption, the only thing a test like this can provide is issues for people using the app.

@Nocccer
Copy link
Collaborator

Nocccer commented Jan 17, 2023

Please provide your shortcuts.vdf so i can might can fix that and update our tests.

The fix would be to check for AppName, appname and now for appName. I would asume another third party tool adds the appName. Had no problem on steam deck with heroic and manually added games.

The fix is to not test it at all, if another entry is (potentially) broken that's not relevant to adding new entry.
Even still, steam itself adds entries with appName, maybe not on linux, but on windows mine got appName when adding custom shortcuts through steams UI.
The thing is if shortcuts.vdf is truly corrupted, steam will tell you, we don't need a 3rd party tool that at best can match steam's error checking, and most of the time will be behind steam's error checking, and will falsely report corruption, the only thing a test like this can provide is issues for people using the app.

I need the shortcuts.vdf to add this to our test, fix the code till the test passes. If you say you don't need a fix than we can close the issue ?

Steam does not tell you. It just acts wierdly. I think it just does not show corrupted entries. Never got any message in steam that one entry is invalid.

Btw i wrote this add to steam feature, so i already troubleshoot alot.

@rodrigovda
Copy link

rodrigovda commented Jan 17, 2023

Please provide your shortcuts.vdf so i can might can fix that and update our tests.

The fix would be to check for AppName, appname and now for appName. I would assume another third party tool adds the appName. Had no problem on steam deck with heroic and manually added games.

I can confirm that this is a Steam issue, I don't use any third party tools other than Heroic Games Launcher. This might be a Windows-exclusive related issue.

You can reproduce this in Windows by following this steps:

  1. Open Steam
  2. Create a shortcut
  3. Open shortcuts.vdf and check that all AppName entries are written capitalized as follows: appName
  4. Close Steam
  5. Manually edit shortcuts.vdf by replacing all instances of appName with AppName
  6. Open Steam.
  7. Check that shortcuts are still present and still work
  8. Check that shortcuts.vdf isn't modified (AppName capitalization persists)
  9. Edit an existing shortcut or add a new shortcut
  10. Check that ALL instances of AppName have been modified to appName

No 3rd party tools running.

I'll attach 4 versions of shortcuts.vdf:

shortcuts-examples.zip

  • shortcuts-Original.vdf: shortcuts.vdf file created by steam right after manually editing an existing shortcut (Fall Guys - test)
  • shortcuts-Edited.vdf: The same file MANUALLY edited (using Notepad++ replace tool) to replace all instances of appName by AppName (HGL won't report any issues with this file)
  • shortcuts-HGL.vdf: The same file after HGL successfully adds a shortcut to Steam (Dead by Daylight)
  • shortcuts-Final.vdf: The same file after editing the latest shortcut name through Steam (name changed to Dead by Daylight - test)

As you can see, Steam replaces all instances of AppName with appName.

EDIT: formatting

@rodrigovda
Copy link

As I previously mentioned, I think the proper way to handle this isn't to compare with all possible capitalization variations, but to make the check case-insensitive, so if Steam for some reason starts saving it as Appname or, aPPnAME it will still work. Why would they do that? Idk, but they are already inconsistent with AppName vs appName, so better safe than sorry.

No need to hardcode all possible variations

@Nocccer
Copy link
Collaborator

Nocccer commented Jan 17, 2023

As I previously mentioned, I think the proper way to handle this isn't to compare with all possible capitalization variations, but to make the check case-insensitive, so if Steam for some reason starts saving it as Appname or, aPPnAME it will still work. Why would they do that? Idk, but they are already inconsistent with AppName vs appName, so better safe than sorry.

No need to hardcode all possible variations

Yes that was the plan. Still i need the shortcut.vdf to still test if it solves the problem and also check if this is the only problem. Else we need to iterate over and over again with you as tester.

@rodrigovda
Copy link

rodrigovda commented Jan 17, 2023 via email

@Zarklord
Copy link
Contributor Author

Please provide your shortcuts.vdf so i can might can fix that and update our tests.
The fix would be to check for AppName, appname and now for appName. I would asume another third party tool adds the appName. Had no problem on steam deck with heroic and manually added games.

The fix is to not test it at all, if another entry is (potentially) broken that's not relevant to adding new entry.
Even still, steam itself adds entries with appName, maybe not on linux, but on windows mine got appName when adding custom shortcuts through steams UI.
The thing is if shortcuts.vdf is truly corrupted, steam will tell you, we don't need a 3rd party tool that at best can match steam's error checking, and most of the time will be behind steam's error checking, and will falsely report corruption, the only thing a test like this can provide is issues for people using the app.

I need the shortcuts.vdf to add this to our test, fix the code till the test passes. If you say you don't need a fix than we can close the issue ?

Steam does not tell you. It just acts wierdly. I think it just does not show corrupted entries. Never got any message in steam that one entry is invalid.

Btw i wrote this add to steam feature, so i already troubleshoot alot.

You don't need a test at all did you not read what I said?
This test accomplishes NOTHING beneficial, at best this test will do the exact same thing that steam already does every time you start steam.
if your shortcuts.vdf is corrupted, steam WILL tell you. that is the ABSOLUTE best case scenario, is that your test code exactly matches steams, in which case its pointless since steam is already validating the file.
In every other case, including this one that has existed for several months, these tests only make the user experience worse, as the second anything changes, or some feature of the format isn't fully documented, Heroic will wrongfully complain that the shortcuts.vdf is invalid (and also fail to write the new shortcut, breaking the shortcuts feature), this is bad behavior, as the test doesn't and can't actually accomplish its purpose since steam is the only program that can actually validate shortcuts.vdf and never be wrong in its validation.

The only place I can agree to test, is if you want to specifically and only validate the single shortcut that just got added to the file, in which case your validating that the data in the file matches what you just added.

@Nocccer
Copy link
Collaborator

Nocccer commented Jan 17, 2023

Please provide your shortcuts.vdf so i can might can fix that and update our tests.
The fix would be to check for AppName, appname and now for appName. I would asume another third party tool adds the appName. Had no problem on steam deck with heroic and manually added games.

The fix is to not test it at all, if another entry is (potentially) broken that's not relevant to adding new entry.
Even still, steam itself adds entries with appName, maybe not on linux, but on windows mine got appName when adding custom shortcuts through steams UI.
The thing is if shortcuts.vdf is truly corrupted, steam will tell you, we don't need a 3rd party tool that at best can match steam's error checking, and most of the time will be behind steam's error checking, and will falsely report corruption, the only thing a test like this can provide is issues for people using the app.

I need the shortcuts.vdf to add this to our test, fix the code till the test passes. If you say you don't need a fix than we can close the issue ?
Steam does not tell you. It just acts wierdly. I think it just does not show corrupted entries. Never got any message in steam that one entry is invalid.
Btw i wrote this add to steam feature, so i already troubleshoot alot.

You don't need a test at all did you not read what I said? This test accomplishes NOTHING beneficial, at best this test will do the exact same thing that steam already does every time you start steam. if your shortcuts.vdf is corrupted, steam WILL tell you. that is the ABSOLUTE best case scenario, is that your test code exactly matches steams, in which case its pointless since steam is already validating the file. In every other case, including this one that has existed for several months, these tests only make the user experience worse, as the second anything changes, or some feature of the format isn't fully documented, Heroic will wrongfully complain that the shortcuts.vdf is invalid (and also fail to write the new shortcut, breaking the shortcuts feature), this is bad behavior, as the test doesn't and can't actually accomplish its purpose since steam is the only program that can actually validate shortcuts.vdf and never be wrong in its validation.

The only place I can agree to test, is if you want to specifically and only validate the single shortcut that just got added to the file, in which case your validating that the data in the file matches what you just added.

If you know it better you could have fix it by yourself. I troubleshoot alot with this and what steam does, does not apply to what we do. I need the shortcuts.vdf to make sure future code adaption don't break things. Just look closer to the code were we testing our implementation of that future. Atm i just added a case insensitive check without knowing if it breaks something for other people! Also if someone changes the code back to the old implementation the current test will still pass because i have no shortcuts.vdf to test your scenario.

Also i never saw steam complaining about a invalid shortcuts.vdf. Atleast in Linux. During the development i had plenty of invalid shortcuts.vdf and steam reported nothing in the frontend. Maybe the log prints something out, but which user looks at steam logs?

@rodrigovda
Copy link

rodrigovda commented Jan 18, 2023

You don't need a test at all did you not read what I said? This test accomplishes NOTHING beneficial, at best this test will do the exact same thing that steam already does every time you start steam. if your shortcuts.vdf is corrupted, steam WILL tell you. that is the ABSOLUTE best case scenario, is that your test code exactly matches steams, in which case its pointless since steam is already validating the file. In every other case, including this one that has existed for several months, these tests only make the user experience worse, as the second anything changes, or some feature of the format isn't fully documented, Heroic will wrongfully complain that the shortcuts.vdf is invalid (and also fail to write the new shortcut, breaking the shortcuts feature), this is bad behavior, as the test doesn't and can't actually accomplish its purpose since steam is the only program that can actually validate shortcuts.vdf and never be wrong in its validation.

The only place I can agree to test, is if you want to specifically and only validate the single shortcut that just got added to the file, in which case your validating that the data in the file matches what you just added.

You don't need to be an asshole here. There's plenty of reasons to check a file for corruption before writing new stuff into it. If you really think you know better, you should code your own "Epic Games compatible Launcher". Here you and me are just users reporting an issue, and we can suggest our thoughts on where is the issue, but uunless you're planning on fixing it yourself, I would suggest you being polite to the people that are here to fix the issue.

EDIT:
PS: You might realize that this issue was opened by you 2 months ago. I came here 2 days ago with suggestions on the source of the Issue, and there's already a Pull Request on a plausible fix. I was polite and proactive. Your attitude is awful here.

@Zarklord
Copy link
Contributor Author

You don't need a test at all did you not read what I said? This test accomplishes NOTHING beneficial, at best this test will do the exact same thing that steam already does every time you start steam. if your shortcuts.vdf is corrupted, steam WILL tell you. that is the ABSOLUTE best case scenario, is that your test code exactly matches steams, in which case its pointless since steam is already validating the file. In every other case, including this one that has existed for several months, these tests only make the user experience worse, as the second anything changes, or some feature of the format isn't fully documented, Heroic will wrongfully complain that the shortcuts.vdf is invalid (and also fail to write the new shortcut, breaking the shortcuts feature), this is bad behavior, as the test doesn't and can't actually accomplish its purpose since steam is the only program that can actually validate shortcuts.vdf and never be wrong in its validation.
The only place I can agree to test, is if you want to specifically and only validate the single shortcut that just got added to the file, in which case your validating that the data in the file matches what you just added.

You don't need to be an asshole here. There's plenty of reasons to check a file for corruption before writing new stuff into it. If you really think you know better, you should code your own "Epic Games compatible Launcher". Here you and me are just users reporting an issue, and we can suggest our thoughts on where is the issue, but uunless you're planning on fixing it yourself, I would suggest you being polite to the people that are here to fix the issue.

I fail to see how what your saying is true, the person's reply did not indicate they had read a single word I had actually written.
That said, your logic is still wrong, and checking for corruption of the data inside the format literally cannot and will never be helpful for this file. Lets play the scenario's out:

Scenario 1: the shortcuts.vdf is actually really corrupted:

  • With "corruption checking":
    • Heroic informs the user the file is corrupted (which steam also would have done on the next restart of steam).
    • The shortcut is not added to steam.
  • Without "corruption checking":
    • Heroic "adds the shortcut to steam".
    • Steam gets restarted and informs the user the shortcuts file is corrupted, and deletes it.
      The end result in both cases is no shortcut is added to steam. though not checking will make steam restart and get the file "uncorrupted" quicker.

Scenario 2: Heroic thinks shortcut.vdf is corrupted when it actually isn't:

  • With "corruption checking":
    • Heroic informs the user the file is corrupted.
    • The shortcut is not added to steam.
  • Without "corruption checking":
    • Heroic adds the shortcut to steam.
    • Steam gets restarted and the shortcut works.
      In this case, not checking for corruption is a win since it will actually add the shortcut.

Scenario 3: shortcut.vdf is fine according too Heroic:

  • With or without "corruption checking":
    • Heroic adds the shortcut to steam.
    • Steam gets restarted and the shortcut works.
      In this case, the end result is identical.

In every scenario, not checking for corruption results in a equal or better user experience. where corruption checking makes it worse.

EDIT: PS: You might realize that this issue was opened by you 2 months ago. I came here 2 days ago with suggestions on the source of the Issue, and there's already a Pull Request on a plausible fix. I was polite and proactive. Your attitude is awful here.

I think you also failed to read my issue report, as I already pointed out that issue, and even provided a sample portion of my shortcuts.vdf file:

Notice how it has appName, but not AppName or appname, this is due to the error checking not properly checking case insensitivity.

@Nocccer
Copy link
Collaborator

Nocccer commented Jan 18, 2023

You don't need a test at all did you not read what I said? This test accomplishes NOTHING beneficial, at best this test will do the exact same thing that steam already does every time you start steam. if your shortcuts.vdf is corrupted, steam WILL tell you. that is the ABSOLUTE best case scenario, is that your test code exactly matches steams, in which case its pointless since steam is already validating the file. In every other case, including this one that has existed for several months, these tests only make the user experience worse, as the second anything changes, or some feature of the format isn't fully documented, Heroic will wrongfully complain that the shortcuts.vdf is invalid (and also fail to write the new shortcut, breaking the shortcuts feature), this is bad behavior, as the test doesn't and can't actually accomplish its purpose since steam is the only program that can actually validate shortcuts.vdf and never be wrong in its validation.
The only place I can agree to test, is if you want to specifically and only validate the single shortcut that just got added to the file, in which case your validating that the data in the file matches what you just added.

You don't need to be an asshole here. There's plenty of reasons to check a file for corruption before writing new stuff into it. If you really think you know better, you should code your own "Epic Games compatible Launcher". Here you and me are just users reporting an issue, and we can suggest our thoughts on where is the issue, but uunless you're planning on fixing it yourself, I would suggest you being polite to the people that are here to fix the issue.

I fail to see how what your saying is true, the person's reply did not indicate they had read a single word I had actually written. That said, your logic is still wrong, and checking for corruption of the data inside the format literally cannot and will never be helpful for this file. Lets play the scenario's out:

Scenario 1: the shortcuts.vdf is actually really corrupted:

  • With "corruption checking":

    • Heroic informs the user the file is corrupted (which steam also would have done on the next restart of steam).
    • The shortcut is not added to steam.
  • Without "corruption checking":

    • Heroic "adds the shortcut to steam".
    • Steam gets restarted and informs the user the shortcuts file is corrupted, and deletes it.
      The end result in both cases is no shortcut is added to steam. though not checking will make steam restart and get the file "uncorrupted" quicker.

Scenario 2: Heroic thinks shortcut.vdf is corrupted when it actually isn't:

  • With "corruption checking":

    • Heroic informs the user the file is corrupted.
    • The shortcut is not added to steam.
  • Without "corruption checking":

    • Heroic adds the shortcut to steam.
    • Steam gets restarted and the shortcut works.
      In this case, not checking for corruption is a win since it will actually add the shortcut.

Scenario 3: shortcut.vdf is fine according too Heroic:

  • With or without "corruption checking":

    • Heroic adds the shortcut to steam.
    • Steam gets restarted and the shortcut works.
      In this case, the end result is identical.

In every scenario, not checking for corruption results in a equal or better user experience. where corruption checking makes it worse.

EDIT: PS: You might realize that this issue was opened by you 2 months ago. I came here 2 days ago with suggestions on the source of the Issue, and there's already a Pull Request on a plausible fix. I was polite and proactive. Your attitude is awful here.

I think you also failed to read my issue report, as I already pointed out that issue, and even provided a sample portion of my shortcuts.vdf file:

Notice how it has appName, but not AppName or appname, this is due to the error checking not properly checking case insensitivity.

I understood that. Still you don't see the point of the baseline. Maybe the corruption message is wrong. It should be Could not parse shortcuts.vdf into a typescript object with a structure i expect. The npm package i use does not provide types and we use typescript. Also the check is to see if steam maybe changed something. I aggree the message is wrong, but the check is still needed.

Btw a corrupted shortcuts.vdf is not resolved by steam if i remember correctly. So a check is also needed to not make the shortcuts.vdf more corrupted by bypassing the check. The endresult is to delete the shortcuts.vdf and start from scratch. You want to avoid that on the user side as much as possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants