Skip to content

Commit 944edf2

Browse files
committed
Connection#associate() returns true in case of workaround
1 parent 80e9610 commit 944edf2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/org/keepassxc/Connection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public abstract class Connection implements AutoCloseable {
4242
private final String NOT_CONNECTED = "Not connected to KeePassXC. Call connect().";
4343
private final String KEYEXCHANGE_MISSING = "Public keys need to be exchanged. Call changePublicKeys().";
4444
private final String MISSING_CLASS = "Credentials have not been initialized";
45+
public final String EXCEPTION_INFO = "Delaying association dialog response lookup due to https://github.com/keepassxreboot/keepassxc/issues/7099";
4546

4647
public Connection() {
4748
byte[] array = new byte[nonceLength];
@@ -319,7 +320,7 @@ public void associate() throws IOException, KeepassProxyAccessException {
319320
support.firePropertyChange("associated", null, credentials);
320321
};
321322
scheduler.schedule(lookupResponse, RESPONSE_DELAY_MS, TimeUnit.MILLISECONDS);
322-
throw new KeepassProxyAccessException("Delaying association dialog response lookup due to https://github.com/keepassxreboot/keepassxc/issues/7099");
323+
throw new KeepassProxyAccessException(EXCEPTION_INFO);
323324
}
324325

325326
/**

src/main/java/org/purejava/KeepassProxyAccess.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ public boolean associate() {
162162
connection.associate();
163163
return true;
164164
} catch (IOException | IllegalStateException | KeepassProxyAccessException e) {
165+
// TODO:
166+
// Revert after Qt bug is fixed
167+
// This compensates throwing a KeepassProxyAccessException in Connection#associate()
168+
if (e.getMessage().equals(connection.EXCEPTION_INFO)) return true;
165169
log.info(e.toString(), e.getCause());
166170
return false;
167171
}

0 commit comments

Comments
 (0)