sentry-unreal icon indicating copy to clipboard operation
sentry-unreal copied to clipboard

should i gitignore .sentry-native?

Open chiptus opened this issue 1 year ago • 6 comments
trafficstars

I recently added the sentry plugin to my game, and seeing that .sentry-native kept changing, I added to gitignore.

Users have complained on different issues related to it. should I return it to the repo?

will it keep changing?

chiptus avatar Aug 14 '24 07:08 chiptus

@chiptus You don't need to keep the .sentry-native folder under source control since it just stores the temporary data that is required by Sentry.

Can you elaborate on those issues your users are facing?

tustanivsky avatar Aug 14 '24 08:08 tustanivsky

@tustanivsky thanks for replying

they get the following message:

Image

basically it says this file is missing

chiptus avatar Aug 14 '24 19:08 chiptus

players keep getting these messages, so we've decided to remove sentry until we clear these

chiptus avatar Aug 15 '24 12:08 chiptus

@chiptus I'm sorry to hear that you've had this issue.

Is there any chance that .sentry-native temporary folder was distributed to your Steam users along with the other game assets? Sentry regenerates everything within it on every game launch so the validation process could fail if it still expects its original content to be there.

As mentioned above .sentry-native should be gitignored and not be included in the game's final package.

tustanivsky avatar Aug 16 '24 07:08 tustanivsky

First, you should write that in your unreal sentrt guide. Second, i understood that and gitignored it from the beginning, but our users still saw it

chiptus avatar Aug 16 '24 07:08 chiptus

@chiptus After investigating it a bit more I think the possible workaround for this issue is to change the location of .sentry-native folder which Sentry creates upon the first game launch here:

https://github.com/getsentry/sentry-unreal/blob/b2d54675f88088f80d6c55b1fe2c8c925775ff1a/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp#L527

Replacing FPaths::ProjectDir() with FPaths::ProjectUserDir() should technically allow avoiding any potential overhead by saving temporary files in the game install directory (like "Program Files" on Windows) which could be write-protected. Instead, these will be placed in the OS-specific user folder (i.e. "C:/Users//AppData/Local/<project_name>") and not interfere with the Steam files validation process.

It's important to make sure that .sentry-native folder is not only gitignored but removed from the source control entirely and that its content doesn't end up in the resulting game package which is then distributed to users.

tustanivsky avatar Aug 16 '24 13:08 tustanivsky

Sounds like a great fix, when will this go into an update?

chiptus avatar Aug 19 '24 06:08 chiptus

Sounds like a great fix, when will this go into an update?

The PR #616 is already there so the potential fix will be included in the next release (probably right after it's merged).

tustanivsky avatar Aug 19 '24 11:08 tustanivsky

thank you, looking forward to it

chiptus avatar Aug 19 '24 14:08 chiptus