Unverified Commit 44e1aa64 authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

ed-odyssey-materials-helper: remove sentry (#432209)

parents e9ad3d0d f763304c
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ stdenv.mkDerivation rec {
    # so this removes 1) the popup about it when you first start the program, 2) the option in the settings
    # and makes the program always know that it is set up
    ./remove-urlscheme-settings.patch

    # Upstream requested that sentry is only to be used with official builds, remove it so it doesn't complain about the lack of DSN
    ./remove-sentry.patch
  ];
  postPatch = ''
    # oslib doesn't seem to do releases and hasn't had a change since 2021, so always use commit d6ee6549bb
@@ -71,11 +74,6 @@ stdenv.mkDerivation rec {

  gradleBuildTask = "application:jpackage";

  env = {
    # The source no longer contains this, so this has been extracted from the binary releases
    SENTRY_DSN = "https://1aacf97280717f749dfc93a1713f9551@o4507814449774592.ingest.de.sentry.io/4507814504759376";
  };

  installPhase = ''
    runHook preInstall

+53 −0
Original line number Diff line number Diff line
diff --git a/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java b/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java
index 04b101f0..2e589e12 100644
--- a/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java
+++ b/application/src/main/java/nl/jixxed/eliteodysseymaterials/Main.java
@@ -51,48 +51,6 @@ public class Main {
                 System.exit(0);
             }
             log.info("launching app with java version: " + getVersion());
-            if (System.getProperty("sentry.dsn") == null || System.getProperty("sentry.dsn").isBlank() || System.getProperty("sentry.dsn").equals("null")) {
-                log.error("Sentry DSN is not set. Please set the DSN.");
-            }
-            Sentry.init(options -> {
-
-                final String buildVersion = getBuildVersion();
-                options.setDsn(System.getProperty("sentry.dsn"));
-                options.setEnvironment(getEnvironment(buildVersion));
-                options.setRelease("edomh-app@" + buildVersion);
-                options.setEnabled(!buildVersion.equals("dev"));
-                options.setBeforeSend((event, hint) -> {
-                    if (!VersionService.isLatestVersion()) {
-                        return null;  // Returning null prevents the event from being sent to Sentry
-                    }
-                    if (Duration.between(lastSentTime, Instant.now()).getSeconds() < 30) {
-                        return null;  // Throttle if less than 30 seconds have passed
-                    }
-                    lastSentTime = Instant.now();
-                    String supportFile = "";
-                    try {
-                        supportFile = SupportService.createSupportPackage();
-                    } catch (Exception e) {
-                        log.error("Failed to create support package", e);
-                    }
-                    if (!supportFile.isBlank()) {
-                        Attachment attachment = new Attachment(supportFile);
-                        hint.addAttachment(attachment);
-                    }
-                    OperatingSystem os = new OperatingSystem();
-                    os.setName(System.getProperty("os.name"));
-                    os.setVersion(System.getProperty("os.version"));
-                    os.setBuild(System.getProperty("os.arch"));
-                    event.getContexts().setOperatingSystem(os);
-                    if (APPLICATION_STATE.getFileheader() != null) {
-                        event.setTag("game.version", APPLICATION_STATE.getFileheader().getGameversion());
-                        event.setTag("game.build", APPLICATION_STATE.getFileheader().getBuild());
-                        event.setTag("game.language", APPLICATION_STATE.getFileheader().getLanguage());
-                        event.setTag("game.odyssey", String.valueOf(APPLICATION_STATE.getFileheader().getOdyssey()));
-                    }
-                    return event;
-                });
-            });
             FXApplication.launchFx(args);
         }
     }