diff --git a/CHANGELOG.md b/CHANGELOG.md index b4c57386..edab061d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +# Build 225 (1.3.1) +2023-12-07 + +- Minor fixes + +# ~~Build 224 (1.3.1)~~ +2023-12-06 + +- Fix for keycloak contact addition when keycloak is unreachable + +# ~~Build 223 (1.3.1)~~ +2023-12-05 + +- Various fixes for keycloak/one-to-one interactions + +# ~~Build 222 (1.3.1)~~ +2023-12-05 + +- Fix for invite all group members + + +# ~~Build 221 (1.3.1)~~ +2023-12-04 + +- Make it possible to invite all group members to private discussions + # Build 220 (1.3) 2023-12-04 diff --git a/obv_engine/engine/src/main/java/io/olvid/engine/datatypes/Constants.java b/obv_engine/engine/src/main/java/io/olvid/engine/datatypes/Constants.java index c9a61950..94ca9553 100644 --- a/obv_engine/engine/src/main/java/io/olvid/engine/datatypes/Constants.java +++ b/obv_engine/engine/src/main/java/io/olvid/engine/datatypes/Constants.java @@ -70,7 +70,7 @@ public abstract class Constants { public static final long WELL_KNOWN_REFRESH_INTERVAL = 3_600_000L * 6; // 6 hours // download message - public static final long RELIST_DELAY = 30_000; // 30 seconds + public static final long RELIST_DELAY = 10_000; // 10 seconds // backups public static final long AUTOBACKUP_MAX_INTERVAL = 86_400_000L; // 1 day diff --git a/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/coordinators/DownloadMessagesAndListAttachmentsCoordinator.java b/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/coordinators/DownloadMessagesAndListAttachmentsCoordinator.java index 9c922344..ab78d11d 100644 --- a/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/coordinators/DownloadMessagesAndListAttachmentsCoordinator.java +++ b/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/coordinators/DownloadMessagesAndListAttachmentsCoordinator.java @@ -128,7 +128,7 @@ public void initialQueueing() { } // check all decrypted messages, with attachments, that are not yet marked as listed on the server - InboxMessage[] messagesToMarkAsListedOnServer = InboxMessage.getMessageThatCanBeMarkedAsListedOnServer(fetchManagerSession); + InboxMessage[] messagesToMarkAsListedOnServer = InboxMessage.getMessagesThatCanBeMarkedAsListedOnServer(fetchManagerSession); for (InboxMessage inboxMessage : messagesToMarkAsListedOnServer) { fetchManagerSession.markAsListedOnServerListener.messageCanBeMarkedAsListedOnServer(inboxMessage.getOwnedIdentity(), inboxMessage.getUid()); } @@ -209,7 +209,7 @@ public void onFinishCallback(Operation operation) { scheduler.clearFailedCount(identity); if (listingTruncated) { - // if we listed more than 20 new messages, we might have missed some messages on the server --> trigger a new list in 30 seconds, once messages are processed and deleted from server + // if listing was truncated --> trigger a new list in 10 seconds, once messages are processed and deleted from server scheduler.schedule(identity, () -> queueNewDownloadMessagesAndListAttachmentsOperation(identity, deviceUid), "DownloadMessagesAndListAttachmentsOperation [relist]", Constants.RELIST_DELAY); } diff --git a/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/databases/InboxMessage.java b/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/databases/InboxMessage.java index 47c750f1..349d00e1 100644 --- a/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/databases/InboxMessage.java +++ b/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/databases/InboxMessage.java @@ -457,7 +457,7 @@ public static InboxMessage[] getMissingExtendedPayloadMessages(FetchManagerSessi } // get all messages that have been decrypted, have attachments and are not yet makredAsListedOnServer - public static InboxMessage[] getMessageThatCanBeMarkedAsListedOnServer(FetchManagerSession fetchManagerSession) { + public static InboxMessage[] getMessagesThatCanBeMarkedAsListedOnServer(FetchManagerSession fetchManagerSession) { try (PreparedStatement statement = fetchManagerSession.session.prepareStatement( "SELECT m.* FROM " + TABLE_NAME + " AS m " + " INNER JOIN " + InboxAttachment.TABLE_NAME + " AS a " + diff --git a/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/operations/ServerQueryOperation.java b/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/operations/ServerQueryOperation.java index 99100880..03ca263e 100644 --- a/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/operations/ServerQueryOperation.java +++ b/obv_engine/engine/src/main/java/io/olvid/engine/networkfetch/operations/ServerQueryOperation.java @@ -317,6 +317,12 @@ public void doExecute() { // do nothing for these break; } + } else if (serverQuery.getType().getId() == ServerQuery.TypeId.CHECK_KEYCLOAK_REVOCATION_QUERY_ID && returnStatus == ServerMethod.SERVER_CONNECTION_ERROR) { + // if not able to connect to keycloak, assume the user is not revoked. This is required in setups where one of the user's devices does not have access to keycloak + // TODO: once we implement visibility rules in keycloak, this must be removed and replaced by synchronisation messages between owned devices in the protocol + serverResponse = Encoded.of(true); + finished = true; + return; } cancel(RFC_NETWORK_ERROR); } diff --git a/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/ContactMutualIntroductionProtocol.java b/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/ContactMutualIntroductionProtocol.java index c96b9ec6..61e2db9f 100644 --- a/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/ContactMutualIntroductionProtocol.java +++ b/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/ContactMutualIntroductionProtocol.java @@ -591,6 +591,7 @@ public PropagatedInitialMessage(CoreProtocolMessage coreProtocolMessage, Identit super(coreProtocolMessage, contactIdentityA, contactIdentityB); } + @SuppressWarnings("unused") public PropagatedInitialMessage(ReceivedMessage receivedMessage) throws Exception { super(receivedMessage); } diff --git a/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/OneToOneContactInvitationProtocol.java b/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/OneToOneContactInvitationProtocol.java index 58127ee3..29d66d22 100644 --- a/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/OneToOneContactInvitationProtocol.java +++ b/obv_engine/engine/src/main/java/io/olvid/engine/protocol/protocols/OneToOneContactInvitationProtocol.java @@ -650,10 +650,12 @@ public ConcreteProtocolState executeStep() throws Exception { UUID dialogUuid = UUID.randomUUID(); { - // create a dialog to allow Alice to abort the protocol - CoreProtocolMessage coreProtocolMessage = buildCoreProtocolMessage(SendChannelInfo.createUserInterfaceChannelInfo(getOwnedIdentity(), DialogType.createOneToOneInvitationSentDialog(receivedMessage.contactIdentity), dialogUuid)); - ChannelMessageToSend messageToSend = new DialogInvitationSentMessage(coreProtocolMessage).generateChannelDialogMessageToSend(); - protocolManagerSession.channelDelegate.post(protocolManagerSession.session, messageToSend, getPrng()); + // create a dialog to allow Alice to abort the protocol (only if Bob is not one to one) + if (!protocolManagerSession.identityDelegate.isIdentityAOneToOneContactOfOwnedIdentity(protocolManagerSession.session, getOwnedIdentity(), receivedMessage.contactIdentity)) { + CoreProtocolMessage coreProtocolMessage = buildCoreProtocolMessage(SendChannelInfo.createUserInterfaceChannelInfo(getOwnedIdentity(), DialogType.createOneToOneInvitationSentDialog(receivedMessage.contactIdentity), dialogUuid)); + ChannelMessageToSend messageToSend = new DialogInvitationSentMessage(coreProtocolMessage).generateChannelDialogMessageToSend(); + protocolManagerSession.channelDelegate.post(protocolManagerSession.session, messageToSend, getPrng()); + } } { @@ -1030,10 +1032,12 @@ public ConcreteProtocolState executeStep() throws Exception { UUID dialogUuid = UUID.randomUUID(); { - // create a dialog to allow Alice to abort the protocol - CoreProtocolMessage coreProtocolMessage = buildCoreProtocolMessage(SendChannelInfo.createUserInterfaceChannelInfo(getOwnedIdentity(), DialogType.createOneToOneInvitationSentDialog(receivedMessage.contactIdentity), dialogUuid)); - ChannelMessageToSend messageToSend = new DialogInvitationSentMessage(coreProtocolMessage).generateChannelDialogMessageToSend(); - protocolManagerSession.channelDelegate.post(protocolManagerSession.session, messageToSend, getPrng()); + // create a dialog to allow Alice to abort the protocol (only if Bob is not one to one) + if (!protocolManagerSession.identityDelegate.isIdentityAOneToOneContactOfOwnedIdentity(protocolManagerSession.session, getOwnedIdentity(), receivedMessage.contactIdentity)) { + CoreProtocolMessage coreProtocolMessage = buildCoreProtocolMessage(SendChannelInfo.createUserInterfaceChannelInfo(getOwnedIdentity(), DialogType.createOneToOneInvitationSentDialog(receivedMessage.contactIdentity), dialogUuid)); + ChannelMessageToSend messageToSend = new DialogInvitationSentMessage(coreProtocolMessage).generateChannelDialogMessageToSend(); + protocolManagerSession.channelDelegate.post(protocolManagerSession.session, messageToSend, getPrng()); + } } { diff --git a/obv_messenger/.idea/inspectionProfiles/Project_Default.xml b/obv_messenger/.idea/inspectionProfiles/Project_Default.xml index 98b6a066..0e48db0a 100644 --- a/obv_messenger/.idea/inspectionProfiles/Project_Default.xml +++ b/obv_messenger/.idea/inspectionProfiles/Project_Default.xml @@ -3,6 +3,7 @@