Hotfix mongo`s bugs
Java CI / build (push) Successful in 47s
.NET+Docker CI/CD / Unit and Integration tests (push) Successful in 31s
.NET+Docker CI/CD / Push Docker image to ghcr.io (push) Failing after 29s

Signed-off-by: Dmitrii <computer@yawaflua.tech>

Took 9 minutes
This commit is contained in:
Dmitrii
2026-07-12 07:32:28 +03:00
parent 69244ef832
commit d12890f8eb
7 changed files with 7 additions and 25 deletions
@@ -70,7 +70,7 @@ public class WebhookController( AppDbContext dbContext, ILogger<WebhookControlle
var user = await dbContext.Users.FirstOrDefaultAsync(k => k.ShortId == userShortId);
if (user == null)
return BadRequest("User not found");
var cardToUse = user.Cards.FirstOrDefault(c => c.ShortId == cardShortId && c.Id == cardId && c.WebhookConnected);
var cardToUse = user.Cards.FirstOrDefault(c => c.ShortId == cardShortId && c.Id == cardId && c.WebhookConnected == true);
if (cardToUse == null)
return BadRequest("Card not found");
@@ -9,8 +9,8 @@ public class Card
public string Name { get; set; }
public string SpworldsID { get; set; }
public string Token { get; set; }
public string ShortId { get; set; } = "";
public bool WebhookConnected { get; set; } = false;
public string? ShortId { get; set; } = "";
public bool? WebhookConnected { get; set; } = false;
public int? Balance { get; set; } = -1;
@@ -36,7 +36,6 @@ public class ModMenuIntegration implements ModMenuApi {
final GpsHudPosition[] gpsPosition = {current.gpsPosition()};
final GpsHudPosition[] notificationPosition = {current.notificationPosition()};
final boolean[] telemetryEnabled = {current.telemetryEnabled()};
final int[] telemetryIntervalSeconds = {current.telemetryIntervalSeconds()};
final boolean[] telemetryCollectSystemInfo = {current.telemetryCollectSystemInfo()};
@@ -101,12 +100,6 @@ public class ModMenuIntegration implements ModMenuApi {
// Telemetry settings
ConfigCategory telemetry = builder.getOrCreateCategory(Text.translatable("category.spmega.telemetry"));
telemetry.addEntry(entryBuilder.startBooleanToggle(Text.translatable("option.spmega.telemetry_enabled"), current.telemetryEnabled())
.setDefaultValue(ModConfig.DEFAULT_TELEMETRY_ENABLED)
.setTooltip(Text.translatable("tooltip.spmega.telemetry_enabled"))
.setSaveConsumer(newValue -> telemetryEnabled[0] = newValue)
.build());
telemetry.addEntry(entryBuilder.startIntField(Text.translatable("option.spmega.telemetry_interval"), current.telemetryIntervalSeconds())
.setDefaultValue(ModConfig.DEFAULT_TELEMETRY_INTERVAL_SECONDS)
.setMin(10)
@@ -134,7 +127,6 @@ public class ModMenuIntegration implements ModMenuApi {
gpsEnabledVal,
gpsPosition[0],
notificationPosition[0],
telemetryEnabled[0],
telemetryIntervalSeconds[0],
telemetryCollectSystemInfo[0]
);
@@ -120,7 +120,6 @@ public class SPMegaClient implements ClientModInitializer {
GpsHudRenderer.instance().isEnabled(),
current.gpsPosition(),
current.notificationPosition(),
current.telemetryEnabled(),
current.telemetryIntervalSeconds(),
current.telemetryCollectSystemInfo()
);
@@ -141,7 +141,7 @@ public final class BackendAuthenticator {
String token = json.get("token").getAsString();
SPMega.setConfig(new ModConfig(
config.apiDomain(), token, config.allowBackend(), config.signQuickPayEnabled(),
config.gpsEnabled(), config.gpsPosition(), config.notificationPosition(), config.telemetryEnabled(),
config.gpsEnabled(), config.gpsPosition(), config.notificationPosition(),
config.telemetryIntervalSeconds(), config.telemetryCollectSystemInfo()));
System.out.println("[SPMEGA] Backend auth successful, saved token.");
return true;
@@ -74,12 +74,6 @@ public final class ConfigManager {
shouldSave = true;
}
boolean telemetryEnabled = readBoolean(properties, "telemetry.enabled", defaults.telemetryEnabled());
String rawTelemetry = properties.getProperty("telemetry.enabled");
if (rawTelemetry == null || !Boolean.toString(telemetryEnabled).equalsIgnoreCase(rawTelemetry.trim())) {
shouldSave = true;
}
int telemetryIntervalSeconds = readInt(properties, "telemetry.intervalSeconds", defaults.telemetryIntervalSeconds());
String rawInterval = properties.getProperty("telemetry.intervalSeconds");
if (rawInterval == null || !Integer.toString(telemetryIntervalSeconds).equals(rawInterval.trim())) {
@@ -93,8 +87,7 @@ public final class ConfigManager {
}
ModConfig config = new ModConfig(apiDomain, apiToken, allowAccess, signQuickPayEnabled, gpsEnabled, gpsPosition,
notificationPosition,
telemetryEnabled, telemetryIntervalSeconds, telemetryCollectSystemInfo);
notificationPosition, telemetryIntervalSeconds, telemetryCollectSystemInfo);
if (shouldSave) {
@@ -159,7 +152,6 @@ public final class ConfigManager {
properties.setProperty("gps.enabled", Boolean.toString(config.gpsEnabled()));
properties.setProperty("gps.position", config.gpsPosition().name());
properties.setProperty("notifications.position", config.notificationPosition().name());
properties.setProperty("telemetry.enabled", Boolean.toString(config.telemetryEnabled()));
properties.setProperty("telemetry.intervalSeconds", Integer.toString(config.telemetryIntervalSeconds()));
properties.setProperty("telemetry.collectSystemInfo", Boolean.toString(config.telemetryCollectSystemInfo()));
@@ -2,8 +2,8 @@ package git.yawaflua.tech.spmega;
public record ModConfig(String apiDomain, String apiToken, boolean allowBackend, boolean signQuickPayEnabled,
boolean gpsEnabled, GpsHudPosition gpsPosition,
GpsHudPosition notificationPosition,
boolean telemetryEnabled, int telemetryIntervalSeconds, boolean telemetryCollectSystemInfo) {
GpsHudPosition notificationPosition, int telemetryIntervalSeconds,
boolean telemetryCollectSystemInfo) {
public static final String DEFAULT_API_DOMAIN = "https://spmega.yawaflua.tech";
public static final boolean ALLOW_BACKEND = true;
public static final String DEFAULT_API_TOKEN = "-";
@@ -24,7 +24,6 @@ public record ModConfig(String apiDomain, String apiToken, boolean allowBackend,
DEFAULT_GPS_ENABLED,
DEFAULT_GPS_POSITION,
DEFAULT_NOTIFICATION_POSITION,
DEFAULT_TELEMETRY_ENABLED,
DEFAULT_TELEMETRY_INTERVAL_SECONDS,
DEFAULT_TELEMETRY_COLLECT_SYSTEM_INFO
);