Infinite 'joplin.data.get' loop when configuring the Email plugin
- Dominant language
- TypeScript
- Stars
- 42
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm trying to configure the Email Plugin, but I think there is an infinite loop bug.
## Email provider
I host my personal [mailcow: dockerized](https://github.com/mailcow/mailcow-dockerized) mail server on DigitalOcean.
## Steps to reproduce
1. Open the Email plugin.
2. Click "Manually connect to IMAP".
3. Fill in the information.
1. Email address.
2. Password.
3. Domain.
4. Port 993.
5. TLS enabled.
4. Click LOGIN.
## Problem conditions
The problem does NOT happen on an empty Joplin profile.
If I change to a new profile and configure the plugin, it successfully logs in and imports notes from the mailbox.
Then, if I import my notes from the `.jex` backup into the new profile, it continues working and importing notes from the mailbox.
But after importing my notes from the `.jex` backup, and try to logout and log back in with the Email plugin, the problem happens again.
So I don't know if the bug is in Joplin or in the Email plugin. It seems to only happen when there are notes and notebooks present at the time of logging in. But I'm not sure how to isolate the exact minimal conditions to reproduce the issue.
## Negative testing
I tried with the wrong password, and I got a popup message saying "Error: Authentication failed."
The infinite loop doesn't happen in that case.
## Logs
I enabled debug logs by following [these instructions](https://joplinapp.org/debugging/#desktop-application). Here is an extract of the output, starting at the first instance of the string "Email".
```
2023-06-06 13:54:24: PluginRunner: "Got message (3): joplin.views.panels.postMessage", "["plugin-view-Bishoy.EmailPlugin-panel","enableLoginScreen"]"
2023-06-06 13:54:24: UserWebview: "Got message", "postMessageService.plugin_message", "{"message":"enableLoginScreen"}"
2023-06-06 13:54:24: UserWebview: "Got message", "postMessageService.response", "{"message":{"responseId":"userWebview_16860812622680.20734508102333438","error":null}}"
2023-06-06 13:54:24: "ResourceService::indexNoteResources: Start"
2023-06-06 13:54:24: "ResourceService::indexNoteResources: Completed"
2023-06-06 13:54:24: "ResourceService::deleteOrphanResources:", "[]"
2023-06-06 13:54:25: PluginRunner: "Got message (3): joplin.views.panels.setHtml", ""
2023-06-06 13:54:25: UserWebview: "Got message", "postMessageService.response", "{"message":{"responseId":"userWebview_16860812652820.8807690608651975","error":null}}"
2023-06-06 13:54:25: UserWebview: "Got message", "setHtml", "{"hash":"f99d236664e4e7f4a8ab425f23498b34","html":"
Login
\n\n \n \n\n\n
\n\n
\n \n\n\n
\n\n
\n\n
2023-06-06 13:54:40: UserWebview: "Got message", "postMessageService.response", "{"message":{"responseId":"userWebview_16860812806990.713801072367042","error":null}}"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","52beed25bcb54227972c77e7494fea90"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","93fc6e32a77b40cea499eacd8d1583e3"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","93fc6e32a77b40cea499eacd8d1583e3"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","52beed25bcb54227972c77e7494fea90"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","93fc6e32a77b40cea499eacd8d1583e3"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","52beed25bcb54227972c77e7494fea90"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","52beed25bcb54227972c77e7494fea90"]]"
2023-06-06 13:54:41: PluginRunner: "Got message (3): joplin.data.get", "[["folders","52beed25bcb54227972c77e7494fea90"]]"
```
This loop of `joplin.data.get` messages continues seemingly forever, at a rate of about 500 per second, and with repeating UIDs, until I stop the Joplin application.
In Dovecot logs, I see a successful login, but then nothing else until I close the Joplin application.
```
imap-login: Login: user=<[REDACTED]>, method=PLAIN, rip=[REDACTED], lip=[REDACTED], mpid=342267, TLS, TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
imap([REDACTED])<343090>: Disconnected: Connection closed (IDLE running for 0.001 + waiting input for 1.925 secs, 2 B in + 10 B out, state=wait-input) in=90 out=1176 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.