Various small fixes

This commit is contained in:
crschnick
2025-11-01 18:51:32 +00:00
parent b81a88d3d3
commit 77c8aadb7b
7 changed files with 29 additions and 9 deletions
@@ -92,7 +92,7 @@ public class ContextualFileReferenceChoiceComp extends Comp<CompStructure<HBox>>
.grow(false, true);
var gitShareButton = new ButtonComp(null, new FontIcon("mdi2g-git"), () -> {
if (!AppPrefs.get().enableGitStorage().get()) {
if (!DataStorageSyncHandler.getInstance().supportsSync()) {
AppLayoutModel.get().selectSettings();
AppPrefs.get().selectCategory("vaultSync");
return;
@@ -80,6 +80,14 @@ public abstract class AppOperationMode {
return;
}
// It seems like a few exceptions are thrown in the quantum renderer
// when the screen configuration changes
if (Platform.isFxApplicationThread()
&& ex instanceof IllegalArgumentException
&& ex.getStackTrace()[0].toString().contains("Rectangle2D")) {
return;
}
// There are some accessibility exceptions on macOS, nothing we can do about that
if (Platform.isFxApplicationThread()
&& ex instanceof NullPointerException
@@ -73,7 +73,7 @@ public class AppPrefsStorageHandler {
FileUtils.forceMkdir(file.getParent().toFile());
JacksonMapper.getDefault().writeValue(file.toFile(), content);
} catch (IOException e) {
throw new RuntimeException(e);
ErrorEventFactory.fromThrowable(e).expected().handle();
}
}
@@ -109,7 +109,11 @@ public class BitwardenPasswordManager implements PasswordManager {
CommandBuilder.of().add("bw", "get", "item").addLiteral(key).add("--nointeraction");
var json = JacksonMapper.getDefault()
.readTree(sc.command(cmd).sensitive().readStdoutOrThrow());
var login = json.required("login");
var login = json.get("login");
if (login == null) {
throw new IllegalArgumentException("No usable login found for item name " + key);
}
var user = login.required("username");
var password = login.required("password");
return new CredentialResult(user.isNull() ? null : user.asText(), InPlaceSecretValue.of(password.asText()));
@@ -116,7 +116,15 @@ public class KeePassXcProxyClient {
// Send the message directly
long startTime = System.currentTimeMillis();
sendNativeMessage(keyExchangeMessage);
try {
sendNativeMessage(keyExchangeMessage);
} catch (IOException e) {
var ex = new IllegalStateException(
"KeePassXC client did not respond. Is the browser integration enabled for your KeePassXC database?", e);
ErrorEventFactory.preconfigure(
ErrorEventFactory.fromThrowable(ex).expected().documentationLink(DocumentationLink.KEEPASSXC));
throw ex;
}
// Wait for a direct response rather than using CompletableFuture
// This is a special case because we can't use the encryption yet
@@ -18,10 +18,7 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardWatchEventKinds;
import java.nio.file.WatchEvent;
import java.nio.file.*;
import java.time.Duration;
import java.time.Instant;
import java.util.*;
@@ -110,6 +107,9 @@ public class FileBridge {
in.transferTo(OutputStream.nullOutputStream());
var taken = Duration.between(started, Instant.now());
event("Wrote " + HumanReadableFormat.byteCount(actualSize) + " in " + taken.toMillis() + "ms");
} catch (NoSuchFileException ex) {
// The file might be removed meanwhile
ErrorEventFactory.fromThrowable(ex).expected().omit().handle();
}
} else {
event("File doesn't seem to be changed");
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME