From aa823200786179211c24190e1a97432fd5e0112a Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 22 Apr 2025 00:28:39 +0600 Subject: [PATCH 1/2] fix: Owncloud requests doesn't updating credentials Owncloud clients are not loading credential from the accountManager everytime it is called. This is making issue for oidc requests as bearerToken is updated frequently, but the client doesn't update this. Here we are always updating the credentials. issue: https://gitlab.e.foundation/e/infra/backlog/-/issues/4085 --- .../android/lib/common/OwnCloudClientManager.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/library/src/main/java/com/owncloud/android/lib/common/OwnCloudClientManager.java b/library/src/main/java/com/owncloud/android/lib/common/OwnCloudClientManager.java index 83e211bba..5e325fd40 100644 --- a/library/src/main/java/com/owncloud/android/lib/common/OwnCloudClientManager.java +++ b/library/src/main/java/com/owncloud/android/lib/common/OwnCloudClientManager.java @@ -148,7 +148,7 @@ public class OwnCloudClientManager { Log_OC.v(TAG, "reusing client for session " + sessionName); } AccountUtils.restoreCookies(accountName, client, context); - keepCredentialsUpdated(account, client); + keepCredentialsUpdated(context, account, client); keepUriUpdated(account, client); } @@ -334,13 +334,9 @@ public class OwnCloudClientManager { } - private void keepCredentialsUpdated(OwnCloudAccount account, OwnCloudClient reusedClient) { - OwnCloudCredentials recentCredentials = account.getCredentials(); - if (recentCredentials != null && !recentCredentials.getAuthToken().equals( - reusedClient.getCredentials().getAuthToken())) { - reusedClient.setCredentials(recentCredentials); - } - + private void keepCredentialsUpdated(Context context, OwnCloudAccount account, OwnCloudClient reusedClient) throws OperationCanceledException, AuthenticatorException, IOException { + account.loadCredentials(context); + reusedClient.setCredentials(account.getCredentials()); } // this method is just a patch; we need to distinguish accounts in the same host but -- GitLab From ec12446d72ca0a1d162de19819a5bed80c5f9c59 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 22 Apr 2025 00:30:42 +0600 Subject: [PATCH 2/2] chore: Bump the version to 2.0.1-u2.17 --- library/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/build.gradle b/library/build.gradle index 79c688ede..08fb45aaa 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -47,7 +47,7 @@ configurations { def versionMajor = 2 def versionMinor = 0 -def versionPatch = 0 +def versionPatch = 1 def upstreamVersion = "2.17" def releasePatch = "release" def libName = "Nextcloud-Android-Library" -- GitLab