anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: square/moshi
Issue: Parsing fails on NULL field values

This JSON
{
        "id":"2",
        "name":"glpi",
        "firstname":null
}

fails: Expected a value but was NULL at path $.firstname

class ObjectJsonAdapter  in  file StandardJsonAdapters.java
has switch (reader.peek()) {}
there are BEGIN_ARRAY, BEGIN_OBJECT, STRING, NUMBER, BOOLEAN
and noooooo  NULL value  among  cases !!!


Changed files:
moshi/src/main/java/com/squareup/moshi/StandardJsonAdapters.java, moshi/src/test/java/com/squareup/moshi/ObjectAdapterTest.java

diff --git a/moshi/src/main/java/com/squareup/moshi/StandardJsonAdapters.java b/moshi/src/main/java/com/squareup/moshi/StandardJsonAdapters.java
index 9283680..7e9c763 100644
--- a/moshi/src/main/java/com/squareup/moshi/StandardJsonAdapters.java
+++ b/moshi/src/main/java/com/squareup/moshi/StandardJsonAdapters.java
@@ -239,6 +239,9 @@ final class StandardJsonAdapters {
         case BOOLEAN:
           return reader.nextBoolean();
 
+        case NULL:
+          return reader.nextNull();
+
         default:
           throw new IllegalStateException("Expected a value but was " + reader.peek()
               + " at path " + reader.getPath());
diff --git a/moshi/src/test/java/com/squareup/moshi/ObjectAdapterTest.java b/moshi/src/test/java/com/squareup/moshi/ObjectAdapterTest.java
index eea2669..d85daad 100644
--- a/moshi/src/test/java/com/squareup/moshi/ObjectAdapterTest.java
+++ b/moshi/src/test/java/com/squareup/moshi/ObjectAdapterTest.java
@@ -84,6 +84,17 @@ public final class ObjectAdapterTest {
     assertThat(adapter.fromJson("[0, 1]")).isEqualTo(Arrays.asList(0d, 1d));
   }
 
+  @Test public void fromJsonDoesNotFailOnNullValues() throws Exception {
+    Map<Object, Object> emptyDelivery = new LinkedHashMap<>();
+    emptyDelivery.put("address", null);
+    emptyDelivery.put("items", null);
+
+    Moshi moshi = new Moshi.Builder().build();
+    JsonAdapter<Object> adapter = moshi.adapter(Object.class);
+    assertThat(adapter.fromJson("{\\"address\\":null, \\"items\\":null}"))
+        .isEqualTo(emptyDelivery);
+  }
+
   @Test public void toJsonCoercesRuntimeTypeForCollections() throws Exception {
     Collection<String> collection = new AbstractCollection<String>() {
       @Override public Iterator<String> iterator() {
Repository: dropwizard/dropwizard
Issue: fix dropwizard-health log message

HealthCheckScheduler log message doesn't log the _value_ of the Counter object, but logs the object instead.


> DEBUG [2022-03-09 20:47:59,008] io.dropwizard.health.HealthCheckScheduler [thread=health-check-example-app-1]: Scheduled check: check=ScheduledHealthCheck{name='example-app-db', critical=true, healthCheck=io.dropwizard.jdbi3.JdbiHealthCheck@46a488c2, schedule=io.dropwizard.health.Schedule@626b286d, state=State{name='example-app-db', successAttempts=2, failureAttempts=3, healthStateListener=io.dropwizard.health.HealthCheckManager@43e1692f, counter=0, healthy=true}, healthyCheckCounter=com.codahale.metrics.Counter@6242ae3b, unhealthyCheckCounter=com.codahale.metrics.Counter@65ddee5a}

Dropwizard version: 2.1.0-beta.7

Changed files:
dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java

diff --git a/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java b/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java
index 349c6001d..ecec175c2 100644
--- a/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java
+++ b/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java
@@ -111,9 +111,13 @@ class ScheduledHealthCheck implements Runnable {
         sb.append(", healthCheck=").append(healthCheck);
         sb.append(", schedule=").append(schedule);
         sb.append(", state=").append(state);
-        sb.append(", healthyCheckCounter=").append(healthyCheckCounter);
-        sb.append(", unhealthyCheckCounter=").append(unhealthyCheckCounter);
+        sb.append(", healthyCheckCounter=").append(getCounterString(healthyCheckCounter));
+        sb.append(", unhealthyCheckCounter=").append(getCounterString(unhealthyCheckCounter));
         sb.append('}');
         return sb.toString();
     }
+
+    private String getCounterString(Counter counter) {
+        return Counter.class.equals(counter.getClass()) ? String.valueOf(counter.getCount()) : counter.toString();
+    }
 }
Repository: trinodb/trino
Issue: Unnecessary wrapping of TrinoException due to LazyConnection usage in CachingJdbcClient

https://github.com/trinodb/trino/pull/7069 introduced `LazyConnection` that opens a connection on first usage, not when it's acquired in the code path.

This changed how exceptions are handled in the `CachingJdbcClient`. Prior to that change when executing i.e. `show tables from mysql.default;` client would get:

```
trino> show tables from mysql.default;
Query 20210308_093838_00002_itbrt failed: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
```

Now it ends with:
```
trino> show tables from mysql.default;
Query 20210308_094545_00000_iaeyw failed: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
``` 

Changed files:
plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlClient.java

diff --git a/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlClient.java b/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlClient.java
index 99a6bbd54f..16f8f41f9b 100644
--- a/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlClient.java
+++ b/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlClient.java
@@ -189,7 +189,7 @@ public class MySqlClient
             return schemaNames.build();
         }
         catch (SQLException e) {
-            throw new RuntimeException(e);
+            throw new TrinoException(JDBC_ERROR, e);
         }
     }
Repository: thundernest/k-9
Issue: Contact pictures not shown

### Expected behavior
If a mail comes in from a contact with a picture in address book and the option "show contact picture" is set, the **picture from the address book should be displayed**.

### Actual behavior
Only a generic first-letter-of-name picture is displayed in the mail. If you click on it, the correct contact in contact app will be opened. **k9 has the contact permission**. I suppose the **contact is correctly linked** to the address, **but the picture wont show up**.

### Steps to reproduce
1. Add a contact to the address book with mail and picture
2. Receive a mail from that contact
3. Open the message list

### Environment
K-9 Mail version: 5.703

Android version: 9 (lineageos 16)

Account type: IMAP

*There was no usable information in the debug log.*

Changed files:
app/core/src/main/java/com/fsck/k9/helper/Contacts.java

diff --git a/app/core/src/main/java/com/fsck/k9/helper/Contacts.java b/app/core/src/main/java/com/fsck/k9/helper/Contacts.java
index e9de1f814..94698809f 100644
--- a/app/core/src/main/java/com/fsck/k9/helper/Contacts.java
+++ b/app/core/src/main/java/com/fsck/k9/helper/Contacts.java
@@ -6,7 +6,6 @@ import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
-import android.database.AbstractCursor;
 import android.database.Cursor;
 import android.net.Uri;
 import android.provider.ContactsContract;
@@ -268,11 +267,8 @@ public class Contacts {
     }
 
     private boolean hasContactPermission() {
-        boolean canRead = ContextCompat.checkSelfPermission(mContext,
+        return ContextCompat.checkSelfPermission(mContext,
                 Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED;
-        boolean canWrite = ContextCompat.checkSelfPermission(mContext,
-                Manifest.permission.WRITE_CONTACTS) == PackageManager.PERMISSION_GRANTED;
-        return  canRead && canWrite;
     }
 
     /**
Repository: thundernest/k-9
Issue: crash: reply to encrypted mail


### Expected behavior
open new mail screen.

### Actual behavior
K9 displays new mail screen and crashes.

03-16 12:15:32.187 E/AndroidRuntime(31412): java.lang.NullPointerException: Attempt to invoke interface method 'com.fsck.k9.mail.Body com.fsck.k9.mail.Part.getBody()' on a null object reference

This seems related to I have no encryption add-on installed.

### Steps to reproduce
1. open encrypted mail (info: install add-on to view decrypted content)
2. press reply button
3. crash

### Environment
K-9 Mail version: 5.403

Android version: 7.1.2

Account type (IMAP, POP3, WebDAV/Exchange):
IMAP

Changed files:
app/core/src/main/java/com/fsck/k9/mailstore/MessageViewInfo.java

diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/MessageViewInfo.java b/app/core/src/main/java/com/fsck/k9/mailstore/MessageViewInfo.java
index 64ba2ca7c..35795fff2 100644
--- a/app/core/src/main/java/com/fsck/k9/mailstore/MessageViewInfo.java
+++ b/app/core/src/main/java/com/fsck/k9/mailstore/MessageViewInfo.java
@@ -4,8 +4,12 @@ package com.fsck.k9.mailstore;
 import java.util.Collections;
 import java.util.List;
 
+import com.fsck.k9.mail.Body;
 import com.fsck.k9.mail.Message;
+import com.fsck.k9.mail.MessagingException;
 import com.fsck.k9.mail.Part;
+import com.fsck.k9.mail.internet.MimeBodyPart;
+import com.fsck.k9.mail.internet.TextBody;
 
 
 public class MessageViewInfo {
@@ -50,7 +54,15 @@ public class MessageViewInfo {
     }
 
     public static MessageViewInfo createWithErrorState(Message message, boolean isMessageIncomplete) {
-        return new MessageViewInfo(message, isMessageIncomplete, null, null, false, null, null, null, null, null, null);
+        try {
+            Body emptyBody = new TextBody("");
+            Part emptyPart = new MimeBodyPart(emptyBody, "text/plain");
+            String subject = message.getSubject();
+            return new MessageViewInfo(message, isMessageIncomplete, emptyPart, subject, false, null, null, null, null,
+                    null, null);
+        } catch (MessagingException e) {
+            throw new AssertionError(e);
+        }
     }
 
     public static MessageViewInfo createForMetadataOnly(Message message, boolean isMessageIncomplete) {
Repository: thundernest/k-9
Issue: Notification isn't removed when message is marked as read or deleted locally

### Checklist

- [X] I have used the search function to see if someone else has already submitted the same bug report.
- [X] I will describe the problem with as much detail as possible.

### App version

5.911

### Where did you get the app from?

_No response_

### Android version

doesn't matter

### Device model

_No response_

### Steps to reproduce

1. Open the message list screen for a folder
2. Refresh the folder when there's a new message on the server so a 'new message' notification is created
3. Long-press the new message in the list to select it
4. Either mark the message as read or delete it


### Expected behavior

The notification for the message is removed.

### Actual behavior

The notification is not removed.

### Logs

_No response_

Changed files:
app/core/src/main/java/com/fsck/k9/controller/MessagingController.java

diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
index ff1cb2fa4..12cd1439a 100644
--- a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -1167,6 +1167,10 @@ public class MessagingController {
                 l.folderStatusChanged(account, folderId);
             }
 
+            if (flag == Flag.SEEN && newState) {
+                cancelNotificationsForMessages(account, folderId, uids);
+            }
+
             if (accountSupportsFlags) {
                 LocalFolder localFolder = localStore.getFolder(folderId);
                 try {
@@ -1183,6 +1187,13 @@ public class MessagingController {
         }
     }
 
+    private void cancelNotificationsForMessages(Account account, long folderId, List<String> uids) {
+        for (String uid : uids) {
+            MessageReference messageReference = new MessageReference(account.getUuid(), folderId, uid);
+            notificationController.removeNewMailNotification(account, messageReference);
+        }
+    }
+
     /**
      * Set or remove a flag for a set of messages in a specific folder.
      * <p>
@@ -2050,6 +2061,8 @@ public class MessagingController {
             List<LocalMessage> syncedMessages = new ArrayList<>();
             List<String> syncedMessageUids = new ArrayList<>();
             for (LocalMessage message : messages) {
+                notificationController.removeNewMailNotification(account, message.makeMessageReference());
+
                 String uid = message.getUid();
                 if (uid.startsWith(K9.LOCAL_UID_PREFIX)) {
                     localOnlyMessages.add(message);
Repository: thundernest/k-9
Issue: Outbox Refreshes Once Mail Sends But Leaves Numbers With Empty Outbox

Please search to check for an existing issue (including closed issues, for which the fix may not have yet been released) before opening a new issue: https://github.com/k9mail/k-9/issues?q=is%3Aissue

If you are unsure whether or not you have found a bug please post to the support forum instead: https://forum.k9mail.app

**Describe the bug**

Outbox numeric counts says there is items being sent when the outbox is empty. Only way to remove it is by refreshing the inbox or other folder.

**To Reproduce**

1. Send mail
2. Outbox contains being sent mail and once refreshes it still contains numeric count on empty outbox
3. Refresh inbox or other folder. Refreshing outbox doesn't fix it. 
4. See error fixed in numeric count on outbox

**Expected behavior**

No numeric count on empty outbox. A refresh shouldn't need to be done on other folder to get numeric count gone on empty outbox. 

**Screenshots**

None

**Environment (please complete the following information):**
 - K-9 Mail version: 5.907
 - Android version: 10
 - Device: Galaxy S9 +
 - Account type: IMAP (Does on POP3 too)

**Additional context**

None

**Logs**

None



Changed files:
app/core/src/main/java/com/fsck/k9/controller/MessagingController.java

diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
index 3e1a70258..ba4ca011e 100644
--- a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -1662,6 +1662,10 @@ public class MessagingController {
                 processPendingCommands(account);
             }
         }
+
+        for (MessagingListener listener : getListeners()) {
+            listener.folderStatusChanged(account, account.getOutboxFolderId());
+        }
     }
 
     private void handleSendFailure(Account account, LocalFolder localFolder, Message message, Exception exception)
Repository: thundernest/k-9
Issue: youtube loads in the message window

### Expected behavior
When opening a message from a subscribed youtube channel and after pressing the video thumbnail or link, a popup should appear asking you which application to use to open the video link.

### Actual behavior
The video loads in the message window.

### Steps to reproduce
1. Open the message with the youtube link
2. Click on the thumbnail or video link

### Environment
K-9 Mail version: 5.704

Android version: 5.1

Account type (IMAP, POP3, WebDAV/Exchange): IMAP

Please take some time to [retrieve logs](https://github.com/k9mail/k-9/wiki/LoggingErrors) and attach them here:


Changed files:
app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java

diff --git a/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java b/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java
index 8fdc85179..29ef07e44 100644
--- a/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java
+++ b/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java
@@ -10,6 +10,7 @@ import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
+import android.os.Build;
 import android.provider.Browser;
 import android.text.TextUtils;
 import android.webkit.WebResourceRequest;
@@ -19,6 +20,8 @@ import android.webkit.WebViewClient;
 import android.widget.Toast;
 
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+
 import com.fsck.k9.mailstore.AttachmentResolver;
 import com.fsck.k9.ui.R;
 import com.fsck.k9.view.MessageWebView.OnPageFinishedListener;
@@ -49,8 +52,17 @@ public class K9WebViewClient extends WebViewClient {
     }
 
     @Override
+    public boolean shouldOverrideUrlLoading(WebView webView, String url) {
+        return shouldOverrideUrlLoading(webView, Uri.parse(url));
+    }
+
+    @Override
+    @RequiresApi(Build.VERSION_CODES.N)
     public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest request) {
-        Uri uri = request.getUrl();
+        return shouldOverrideUrlLoading(webView, request.getUrl());
+    }
+
+    private boolean shouldOverrideUrlLoading(WebView webView, Uri uri) {
         if (CID_SCHEME.equals(uri.getScheme())) {
             return false;
         }
Repository: thundernest/k-9
Issue: youtube loads in the message window

### Expected behavior
When opening a message from a subscribed youtube channel and after pressing the video thumbnail or link, a popup should appear asking you which application to use to open the video link.

### Actual behavior
The video loads in the message window.

### Steps to reproduce
1. Open the message with the youtube link
2. Click on the thumbnail or video link

### Environment
K-9 Mail version: 5.704

Android version: 5.1

Account type (IMAP, POP3, WebDAV/Exchange): IMAP

Please take some time to [retrieve logs](https://github.com/k9mail/k-9/wiki/LoggingErrors) and attach them here:


Changed files:
app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java

diff --git a/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java b/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java
index aac73ba73..8fdc85179 100644
--- a/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java
+++ b/app/ui/src/main/java/com/fsck/k9/view/K9WebViewClient.java
@@ -16,9 +16,11 @@ import android.webkit.WebResourceRequest;
 import android.webkit.WebResourceResponse;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
+import android.widget.Toast;
 
 import androidx.annotation.Nullable;
 import com.fsck.k9.mailstore.AttachmentResolver;
+import com.fsck.k9.ui.R;
 import com.fsck.k9.view.MessageWebView.OnPageFinishedListener;
 import timber.log.Timber;
 
@@ -56,15 +58,13 @@ public class K9WebViewClient extends WebViewClient {
         Context context = webView.getContext();
         Intent intent = createBrowserViewIntent(uri, context);
 
-        boolean overridingUrlLoading = false;
         try {
             context.startActivity(intent);
-            overridingUrlLoading = true;
         } catch (ActivityNotFoundException ex) {
-            // If no application can handle the URL, assume that the WebView can handle it.
+            Toast.makeText(context, R.string.error_activity_not_found, Toast.LENGTH_LONG).show();
         }
 
-        return overridingUrlLoading;
+        return true;
     }
 
     private Intent createBrowserViewIntent(Uri uri, Context context) {
Repository: thundernest/k-9
Issue: Non-existent folder in PendingMoveOrCopy

Note: maybe related or duplicated with #4420 , but opening a new issue since I'm not sure.

Hello,
Thanks for working and offering k-9 mail, it's very useful piece of software.
I use the F-Droid version and recently upgraded from 5.600 to 5.700 (and then the next ones. Currently I'm using 5.703).

I use K-9 in telephone with Lineage 14 (Android 7.1.2), and I have several IMAP accounts configured.
For one of them, I'm experiencing an issue: when I mark as read a message, or I open to read it, it appears as "read" in K-9, but it seems that such status does not propagate to the server: when I refresh or obtain new mail, the messages that I've read in K-9 become "unread" again.

If I do the opposite (mark a read message as "not read"), when I refresh, the message becomes "read" again.

The same happens when I star/unstar a message.

I'm attaching a log of the action of reading several mails, and then, refreshing to receive new mail if available.

[k9-log-failure.txt](https://github.com/k9mail/k-9/files/4045387/k9-log-failure.txt)

The strange thing is that this happens only with this account (which receives dozens of mails daily). I have another account configured with much less traffic (1-2 mails each several days) and I cannot reproduce the problem in this second account. Both accounts are from the same provider (Gandi).

I have tried to uninstall K-9 and install again, and configure the account manually, but the problem persist. I have reviewed all the settings (general and account settings) to try to figure out if it was some setting by mistake, but I cannot find anything related to the issue.

Thanks!


Changed files:
app/core/src/main/java/com/fsck/k9/controller/MessagingController.java

diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
index b21b0c00d..d15b60eb5 100644
--- a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -2255,7 +2255,8 @@ public class MessagingController {
                 processPendingCommands(account);
             } else if (!syncedMessageUids.isEmpty()) {
                 if (account.getDeletePolicy() == DeletePolicy.ON_DELETE) {
-                    if (folder.equals(account.getTrashFolder()) || !backend.isDeleteMoveToTrash()) {
+                    if (!account.hasTrashFolder() || folder.equals(account.getTrashFolder()) ||
+                            !backend.isDeleteMoveToTrash()) {
                         queueDelete(account, folder, syncedMessageUids);
                     } else if (account.isMarkMessageAsReadOnDelete()) {
                         queueMoveOrCopy(account, folder, account.getTrashFolder(),
Repository: thundernest/k-9
Issue: "Delete spam messages immediately without moving them to the trash folder" doesn't delete Email in Spam Folder

### Checklist

- [X] I have used the search function to see if someone else has already submitted the same bug report.
- [X] I will describe the problem with as much detail as possible.

### App version

6.501

### Where did you get the app from?

Other

### Android version

13

### Device model

Pixel 5

### Steps to reproduce

"Delete spam messages immediately without moving them to the trash folder" doesn't delete Email in Spam Folder, just removes it in the K9 Spam Folder.

Go to Spam Folder.
Delete Spam Emails.
All looks OK.

Open email account in web browser or IMAPSize.
The Spam Emails are still in the Spam / Junk folder. K9 just don't show them any more.




### Expected behavior

I'd expected K9 to delete message and expunge the mailbox.

### Actual behavior

 The Spam Emails are still in the Spam / Junk folder. K9 just don't show them any more.

### Logs

No Logs needed. Simple to reproduce.

Changed files:
app/core/src/main/java/com/fsck/k9/controller/MessagingController.java

diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
index 16944e743..dfa2cc252 100644
--- a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -2025,10 +2025,13 @@ public class MessagingController {
             Map<String, String> uidMap = null;
             Long trashFolderId = account.getTrashFolderId();
             boolean isSpamFolder = account.hasSpamFolder() && account.getSpamFolderId() == folderId;
+            boolean doNotMoveToTrashFolder = skipTrashFolder ||
+                !account.hasTrashFolder() || folderId == trashFolderId ||
+                isSpamFolder ||
+                (backend.getSupportsTrashFolder() && !backend.isDeleteMoveToTrash());
 
             LocalFolder localTrashFolder = null;
-            if (skipTrashFolder || !account.hasTrashFolder() || folderId == trashFolderId || isSpamFolder ||
-                    (backend.getSupportsTrashFolder() && !backend.isDeleteMoveToTrash())) {
+            if (doNotMoveToTrashFolder) {
                 Timber.d("Not moving deleted messages to local Trash folder. Removing local copies.");
 
                 if (!localOnlyMessages.isEmpty()) {
@@ -2092,8 +2095,7 @@ public class MessagingController {
                 // Nothing to do on the remote side
             } else if (!syncedMessageUids.isEmpty()) {
                 if (account.getDeletePolicy() == DeletePolicy.ON_DELETE) {
-                    if (!account.hasTrashFolder() || folderId == trashFolderId ||
-                            !backend.isDeleteMoveToTrash()) {
+                    if (doNotMoveToTrashFolder) {
                         queueDelete(account, folderId, syncedMessageUids);
                     } else if (account.isMarkMessageAsReadOnDelete()) {
                         queueMoveOrCopy(account, folderId, trashFolderId,
Repository: thundernest/k-9
Issue: Crash during reading of an email

I receive an email which crashes the app.
After some research, I found that mBody for the file Version_texte.txt is null (LocalBodyPart with minetype "text/plain") and OpenPgpUtils.parseMessage crashes with a null value.
I also tried a new email with this file but mBody is not null.
So I think the issue is located in the loading process.

You can find the mail here : http://guillaume.smaha.net/contrib/k9mail/TestCrashEmail.eml


Changed files:
k9mail/src/main/java/com/fsck/k9/crypto/MessageDecryptVerifier.java

diff --git a/k9mail/src/main/java/com/fsck/k9/crypto/MessageDecryptVerifier.java b/k9mail/src/main/java/com/fsck/k9/crypto/MessageDecryptVerifier.java
index e11e86a32..761dc2e39 100644
--- a/k9mail/src/main/java/com/fsck/k9/crypto/MessageDecryptVerifier.java
+++ b/k9mail/src/main/java/com/fsck/k9/crypto/MessageDecryptVerifier.java
@@ -7,6 +7,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Stack;
 
+import android.text.TextUtils;
+
 import com.fsck.k9.mail.Body;
 import com.fsck.k9.mail.BodyPart;
 import com.fsck.k9.mail.MessagingException;
@@ -86,6 +88,9 @@ public class MessageDecryptVerifier {
 
             if (isSameMimeType(mimeType, TEXT_PLAIN)) {
                 String text = MessageExtractor.getTextFromPart(part);
+                if (TextUtils.isEmpty(text)) {
+                    continue;
+                }
                 switch (OpenPgpUtils.parseMessage(text)) {
                     case OpenPgpUtils.PARSE_RESULT_MESSAGE:
                     case OpenPgpUtils.PARSE_RESULT_SIGNED_MESSAGE:
Repository: thundernest/k-9
Issue: backslash in username does not work for IMAP login

I need to access an exchange server via IMAP. My username has the form username@domain\\special_mailbox .
Authentication with just username for the personal mailbox works fine but not for the special mailbox with the backslash syntax above.
I tried two backslashes since I suspected some java string escaping problem, but that did not work either.


Changed files:
k9mail-library/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java

diff --git a/k9mail-library/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java b/k9mail-library/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java
index a81408755..ada1a1f53 100644
--- a/k9mail-library/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java
+++ b/k9mail-library/src/main/java/com/fsck/k9/mail/store/imap/ImapConnection.java
@@ -364,6 +364,14 @@ class ImapConnection {
         }
     }
 
+    protected void saslAuthPlainWithLoginFallback() throws IOException, MessagingException {
+        try {
+            saslAuthPlain();
+        } catch (AuthenticationFailedException e) {
+            login();
+        }
+    }
+
     protected ImapResponse readContinuationResponse(String tag)
             throws IOException, MessagingException {
         ImapResponse response;
@@ -510,7 +518,7 @@ class ImapConnection {
 
             case PLAIN:
                 if (hasCapability(CAPABILITY_AUTH_PLAIN)) {
-                    saslAuthPlain();
+                    saslAuthPlainWithLoginFallback();
                 } else if (!hasCapability(CAPABILITY_LOGINDISABLED)) {
                     login();
                 } else {
Repository: thundernest/k-9
Issue: Notification stays after reading e-mail

### Expected behaviour

Notification disappears after reading an e-mail.
### Actual behaviour

The notification stays after reading the e-mail, when the e-mail was received by refreshing the inbox out of the inbox.
### Steps to reproduce
1. Go to the inbox, where you expect to get an e-mail in.
2. Refresh the inbox, so you receive the e-mail.
3. Click on the new e-mail to read it.
4. (optional) Go back to the inbox by any back button. You see the e-mail is definitely marked unread.
5. Press the home button to leave K-9.
### Environment

K-9 Mail version: 5.008

Android version: 5.1.1

Account type (IMAP, POP3, WebDAV/Exchange): IMAP


Changed files:
k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java

diff --git a/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java b/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java
index 8f51a5222..efc039033 100644
--- a/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -2871,6 +2871,7 @@ public class MessagingController implements Runnable {
         localFolder.fetch(Collections.singletonList(message), fp, null);
         localFolder.close();
 
+        notificationController.removeNewMailNotification(account, message.makeMessageReference());
         markMessageAsReadOnView(account, message);
 
         return message;
Repository: thundernest/k-9
Issue: Quoted-printable encoding inserts unnecessary line breaks

K-9 Mail created a message that contained unnecessary line breaks in the encoded message body.
(v5.111)

```
[...]
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

[...]
-----BEGIN PGP SIGNATURE-----

iQI0BAEBCgAeFxxCZXJuZCA8dGVzdEBja2V0dGkuZGU=
+BQJX1LDSAAoJEG2bO4IG
m2wDJ6YQAIc3oA5JPv122U0IdBWN0c0CPr0bm6e+Z7dlAOCmNdhO/=
WxhMTEI1u4v
AL9AySWQIeek3tWZJSgSfhULXCC1ZUU2tWA/1cpf9PMpdXknJvi8y34osV+0SnU=
/
LhIkMPUK2wGUYmDUvBL2g9Zbx4giknta+2/IbaGMljRHQuDV1XpHEVDKzRE73VID
xn7F7CSI=
xkQGPI6mNOuM70BsaVyCwrTRiSW4rnwe2CgLf+RVSePCnveTjxC6xZyC
Q7z1LBKGNEvw0PRKjM=
1IbNeFSJ3y73RBS4y1cDYECWxKPjDJ5PR9x2QzcTdqKbXp
pVXJEv/8SzurR99V1OvlTS3s2tdS=
fSLpd9uP1hqxK71Dek5fcMUHQqgsIz2mmiEa
dExWc9dItBjgH9dPyBXn9m/G5UnF1E8FbqlS7J=
swgfiW0KNAkYEsFyvjp7q7W6TK
qkYnxJCENCG4Hf+lofDEzHth/uu23Z7cHhjkzZDet0dMGpA+=
B1jH9ZVu4aEoWLGQ
VJ3Lfjqy4ZysAmziR8iKcg3V/q0vmL+zC+3s9U+UaXPbpI2JD/hr89WIkG=
zVnNpG
8hInOIgLOJhui5PFEB7XNdpBJj+O2NYigV76Fvhb4boyCt7VdhRe01C7cohusPHB
/TO=
wbqG+0w+z6eL8tyxZ2HVWFyfgHyarnwGquIxYjxE5OzfS+LN4
=3DS8iC
-----END PGP SIGN=
ATURE-----
```


Changed files:
k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java

diff --git a/k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java b/k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java
index b0c5d10b9..11638b6e0 100644
--- a/k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java
+++ b/k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java
@@ -20,6 +20,7 @@ import com.fsck.k9.mail.Body;
 import com.fsck.k9.mail.BodyPart;
 import com.fsck.k9.mail.BoundaryGenerator;
 import com.fsck.k9.mail.MessagingException;
+import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
 import com.fsck.k9.mail.internet.BinaryTempFileBody;
 import com.fsck.k9.mail.internet.MessageIdGenerator;
 import com.fsck.k9.mail.internet.MimeBodyPart;
@@ -193,6 +194,9 @@ public class PgpMessageBuilder extends MessageBuilder {
                 pgpResultTempBody = new BinaryTempFileBody(
                         capturedOutputPartIs7Bit ? MimeUtil.ENC_7BIT : MimeUtil.ENC_8BIT);
                 outputStream = pgpResultTempBody.getOutputStream();
+                // OpenKeychain/BouncyCastle at this point use the system newline for formatting, which is LF on android.
+                // we need this to be CRLF, so we convert the data after receiving.
+                outputStream = new EOLConvertingOutputStream(outputStream);
             } catch (IOException e) {
                 throw new MessagingException("could not allocate temp file for storage!", e);
             }
Repository: thundernest/k-9
Issue: Switching from dark to light theme (or vise versa) inside message doesn't work

### Expected behavior

When `fixed message theme` option is disabled, switching the theme when viewing a message should switch the theme immediately.
### Actual behavior

After switching the theme inside the message, the message view reloads but the theme stays the same. I need to leave the message and open it again to get the other theme.
### Steps to reproduce
1. Disable `fixed message theme` option
2. Open message and switch to dark / light theme
### Environment

K-9 Mail version: v5.111 + v5.112 (iirc, before v5.111 I didn't have this problem)
Android version: 6.0.1
Account type : IMAP


Changed files:
k9mail/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java

diff --git a/k9mail/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java b/k9mail/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java
index c6be46a1d..d29b79181 100644
--- a/k9mail/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java
+++ b/k9mail/src/main/java/com/fsck/k9/activity/MessageLoaderHelper.java
@@ -146,6 +146,8 @@ public class MessageLoaderHelper {
      * asyncStartOrResumeLoadingMessage in a new instance of this class. */
     @UiThread
     public void onDestroyChangingConfigurations() {
+        cancelAndClearDecodeLoader();
+
         if (messageCryptoHelper != null) {
             messageCryptoHelper.detachCallback();
         }
Repository: thundernest/k-9
Issue: Account listed multiple times

I have three email accounts, which were before listed like this:

```
AccountA
AccountB
AccountC
```

After long-pressing the last account and choosing "Move up", I got two copies of the account that I tried to move, like this:

```
AccountA
AccountC
AccountB
AccountC
```

This state persisted after restarting the app (I think, the app was not listed in task manager), but problem went away after restarting phone, and `AccountC` is now in the middle as expected. Problem is not reproducible, I can now move them around as I please. When I had the problem I moved the account shortly after creating it.

K-9 Mail version: 5.004
Android version: 4.4.2
Phone: LG G2


Changed files:
k9mail/src/main/java/com/fsck/k9/Preferences.java

diff --git a/k9mail/src/main/java/com/fsck/k9/Preferences.java b/k9mail/src/main/java/com/fsck/k9/Preferences.java
index 05b839c5f..dcfc6bba8 100644
--- a/k9mail/src/main/java/com/fsck/k9/Preferences.java
+++ b/k9mail/src/main/java/com/fsck/k9/Preferences.java
@@ -61,7 +61,9 @@ public class Preferences {
         }
         if ((newAccount != null) && newAccount.getAccountNumber() != -1) {
             accounts.put(newAccount.getUuid(), newAccount);
-            accountsInOrder.add(newAccount);
+            if (!accountsInOrder.contains(newAccount)) {
+                accountsInOrder.add(newAccount);
+            }
             newAccount = null;
         }
     }
Repository: thundernest/k-9
Issue: message subject no longer shown on message view

### Expected behavior
the message subject should be shown in the message view

### Actual behavior
the message view no longer shows the message subject

### Steps to reproduce
1. open a message
2. try to read the message subject in the message view

### Environment
K-9 Mail version: 5.201

Android version: 7.1.1

Account type (IMAP, POP3, WebDAV/Exchange): IMAP


Changed files:
k9mail/src/main/java/com/fsck/k9/activity/MessageList.java, k9mail/src/main/java/com/fsck/k9/view/MessageTitleView.java

diff --git a/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java b/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
index c0a6098a6..65cf011b4 100644
--- a/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
+++ b/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
@@ -1435,6 +1435,8 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
     public void displayMessageSubject(String subject) {
         if (mDisplayMode == DisplayMode.MESSAGE_VIEW) {
             mActionBarSubject.setText(subject);
+        } else {
+            mActionBarSubject.showSubjectInMessageHeader();
         }
     }
 
diff --git a/k9mail/src/main/java/com/fsck/k9/view/MessageTitleView.java b/k9mail/src/main/java/com/fsck/k9/view/MessageTitleView.java
index dea974b85..a6cccd4ef 100644
--- a/k9mail/src/main/java/com/fsck/k9/view/MessageTitleView.java
+++ b/k9mail/src/main/java/com/fsck/k9/view/MessageTitleView.java
@@ -51,7 +51,7 @@ public class MessageTitleView extends TextView {
                 if (getLayout().getLineCount() > MAX_LINES) {
                     int lineEndIndex = getLayout().getLineEnd(MAX_LINES - 1);
                     setText(getText().subSequence(0, lineEndIndex - 2) + ELLIPSIS);
-                    mHeader.showSubjectLine();
+                    showSubjectInMessageHeader();
                 }
                 mNeedEllipsizeCheck = false;
             }
@@ -62,4 +62,8 @@ public class MessageTitleView extends TextView {
     public void setMessageHeader(final MessageHeader header) {
         mHeader = header;
     }
+    
+    public void showSubjectInMessageHeader() {
+        mHeader.showSubjectLine();
+    }
 }
Repository: thundernest/k-9
Issue: There is an archive entry in the context entry of the mail in the archive

Please search to check for an existing issue (including closed issues, for which the fix may not have yet been released) before opening a new issue: https://github.com/k9mail/k-9/issues?q=is%3Aissue

### Expected behavior
When I move my mail to the archive, the item to keep in spite of the archive is registered in the context menu.

### Actual behavior
Delete or unarchive archived items in content menu of the archive

### Steps to reproduce
1.Move the mail in your Inbox to the Inbox.

### Environment
K-9 Mail version: 5.600

Android version: 8.0.0

Account type (IMAP, POP3,   ##WebDAV/Exchange):


Changed files:
app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.java

diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.java b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.java
index 54affea70..f480bab24 100644
--- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.java
+++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.java
@@ -1707,11 +1707,17 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
                     menu.findItem(R.id.spam).setVisible(false);
                 }
 
-                if (!account.hasArchiveFolder()) {
+                Long archiveFolderId = account.getArchiveFolderId();
+                boolean hideArchiveAction = archiveFolderId == null ||
+                        (singleFolderMode && currentFolder.databaseId == archiveFolderId);
+                if (hideArchiveAction) {
                     menu.findItem(R.id.archive).setVisible(false);
                 }
 
-                if (!account.hasSpamFolder()) {
+                Long spamFolderId = account.getSpamFolderId();
+                boolean hideSpamAction = spamFolderId == null ||
+                        (singleFolderMode && currentFolder.databaseId == spamFolderId);
+                if (hideSpamAction) {
                     menu.findItem(R.id.spam).setVisible(false);
                 }
             }
Repository: thundernest/k-9
Issue: selecting key from openkeychain fails

k-9 does not accept the cryptographic key from openkeychain.

The key has been created newly by openkeychain using plain defaults from the
wizzard, except for uploading to the internet being off (as these are tests
yet only).

Steps in detail:

In k-9, after selecting the key from the list, the app takes a short breath
for about 1 sec. and then simply behaves as if it was newly started. Looks
like a quick app restart after a crash or so (but there is no crash message).
When entering the menu Cryptography / My key, there is still "no key
selected".

Tried with K-9/OpenKeyChain 5.502/4.9.2 as well as 5.403/4.9.

Android version: 7.1.2 / LineageOS. Security options were off for both
for both apps.



Changed files:
plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java

diff --git a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java
index 15eb44693..dd4b5373d 100644
--- a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java
+++ b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java
@@ -73,6 +73,15 @@ public class OpenPgpKeyPreference extends Preference {
 
     @Override
     protected void onClick() {
+        bindServiceAndGetSignKeyId(new Intent());
+    }
+
+    private void bindServiceAndGetSignKeyId(final Intent data) {
+        if (mServiceConnection != null && mServiceConnection.isBound()) {
+            getSignKeyId(data);
+            return;
+        }
+
         // bind to service
         mServiceConnection = new OpenPgpServiceConnection(
                 getContext().getApplicationContext(),
@@ -81,7 +90,7 @@ public class OpenPgpKeyPreference extends Preference {
                     @Override
                     public void onBound(IOpenPgpService2 service) {
 
-                        getSignKeyId(new Intent());
+                        getSignKeyId(data);
                     }
 
                     @Override
@@ -252,7 +261,7 @@ public class OpenPgpKeyPreference extends Preference {
         public SavedState(Parcel source) {
             super(source);
 
-            keyId = source.readInt();
+            keyId = source.readLong();
             openPgpProvider = source.readString();
             defaultUserId = source.readString();
         }
@@ -284,11 +293,11 @@ public class OpenPgpKeyPreference extends Preference {
 
     public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) {
         if (requestCode == REQUEST_CODE_KEY_PREFERENCE && resultCode == Activity.RESULT_OK) {
-            getSignKeyId(data);
+            bindServiceAndGetSignKeyId(data);
             return true;
         } else {
             return false;
         }
     }
 
-}
\\ No newline at end of file
+}
Repository: thundernest/k-9
Issue: Crash due to Parcelable problem

Crash when restoring AccountSetupBasics instance state

Steps to reproduce the behavior:
1. In developer options: enable don't keep activities" to easily reproduce the bug
2. Go to AccountSetupBasics activity
3. Click home button to quit the app
4. Use recent app to go back to K9
5. The app crash

**Environment (please complete the following information):**
 - K-9 Mail version: [5.725]
 - Android version: [10]
 - Device: [Tablet ordissimo celia]

I suspect the parcelable part in FoldableLinearLayout

**Logs**
2020-12-22 15:11:54.427 15426-15426/com.fsck.k9.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.fsck.k9.debug, PID: 15426
    java.lang.RuntimeException: Parcel android.os.Parcel@3b63efa: Unmarshalling unknown type code 2131362261 at offset 1852
        at android.os.Parcel.readValue(Parcel.java:2945)
        at android.os.Parcel.readSparseArrayInternal(Parcel.java:3329)
        at android.os.Parcel.readSparseArray(Parcel.java:2484)
        at android.os.Parcel.readValue(Parcel.java:2923)
        at android.os.Parcel.readArrayMapInternal(Parcel.java:3246)
        at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292)
        at android.os.BaseBundle.unparcel(BaseBundle.java:236)
        at android.os.Bundle.getSparseParcelableArray(Bundle.java:1029)
        at com.android.internal.policy.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2156)
        at android.app.Activity.onRestoreInstanceState(Activity.java:1590)
        at com.fsck.k9.activity.setup.AccountSetupBasics.onRestoreInstanceState(AccountSetupBasics.java:119)
        at android.app.Activity.performRestoreInstanceState(Activity.java:1545)
        at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1353)



Changed files:
app/ui/legacy/src/main/java/com/fsck/k9/view/FoldableLinearLayout.java

diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/FoldableLinearLayout.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/FoldableLinearLayout.java
index 997167a64..5d0e84ae8 100644
--- a/app/ui/legacy/src/main/java/com/fsck/k9/view/FoldableLinearLayout.java
+++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/FoldableLinearLayout.java
@@ -121,9 +121,9 @@ public class FoldableLinearLayout extends LinearLayout {
         }
     }
 
-    static class SavedState extends BaseSavedState {
+    public static class SavedState extends BaseSavedState {
 
-        static final Parcelable.Creator<SavedState> CREATOR =
+        public static final Parcelable.Creator<SavedState> CREATOR =
                 new Parcelable.Creator<FoldableLinearLayout.SavedState>() {
 
             @Override
Repository: thundernest/k-9
Issue: Read messages keep changing status back to unread

> Sounds like the "mark as read" commands either fail or are stuck in the local command queue and never sent to the server.

Having the same problem with k9 5.724 and an IMAP account. Accidently I tried to move mails to a mail folder which is a directory on the server and can therefore not store any mails. This move command got stuck in the local command queue:
https://gist.github.com/sevenrock/f307d73819455c55ccc30300220d0a0f
and blocks other commands, like changing the read-status of mails.

Is there a way to clear the local command queue without reinstalling k9?

_Originally posted by @sevenrock in https://github.com/k9mail/k-9/issues/1130#issuecomment-734443921_

Changed files:
mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/FolderNotFoundException.java

diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/FolderNotFoundException.java b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/FolderNotFoundException.java
index 871b321a5..3b15551d7 100644
--- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/FolderNotFoundException.java
+++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/FolderNotFoundException.java
@@ -9,7 +9,7 @@ public class FolderNotFoundException extends MessagingException {
 
 
     public FolderNotFoundException(String folderServerId) {
-        super("Folder not found: " + folderServerId);
+        super("Folder not found: " + folderServerId, true);
         this.folderServerId = folderServerId;
     }