Comments (5)
@bishoy-magdy are you able to produce a new release from the latest code? The current 1.0.0 release is out of date and leading to loading/loop issues.
from plugin-email.
@bishoy-magdy Thank you for this plugin, it is the reason I moved from tidliwiki to Joplin. Could you please make a new release of the plugin from the latest code?
from plugin-email.
I think I found the bug. In the source code, the plugin attempts to get all the folders like this:
let joplinFolders: JopinFolders;
const folders = [];
do {
joplinFolders = await joplin.data.get(['folders']);
[build internal index of folders...]
}
} while (joplinFolders.has_more);
However, this is not the correct way to make paginated request; the page
query parameter is missing. When there are more than 100 items to return and joplinFolders.has_more
is true
, only page 1 is requested and the plugin enters an infinite loop.
I think this would work better:
let joplinFolders: JopinFolders;
const folders = [];
let pageNum = 1;
do {
joplinFolders = await joplin.data.get(['folders'], {"page": pageNum++});
[build internal index of folders...]
}
} while (joplinFolders.has_more);
Please note that I have not tested this and I'm not a Typescript or a Javascript programmer.
I also found two places in src/ui/screens.ts
where this infinite loop may happen:
plugin-email/src/ui/screens.ts
Line 207 in 34fe1a4
plugin-email/src/ui/screens.ts
Line 331 in 34fe1a4
References:
- https://joplinapp.org/api/references/rest_api/#pagination
- https://joplinapp.org/api/references/plugin_api/classes/joplindata.html
from plugin-email.
Hi @adeverteuil, Thanks very much for this great description of the issue.
However, this is not the correct way to make paginated request; the page query parameter is missing. When there are more than 100 items to return and joplinFolders.has_more is true, only page 1 is requested and the plugin enters an infinite loop.
This is correct; the bug occurs when the number of folders is greater than 100. I will fix it, and thank you for mentioning it.
To be sure, this is the issue you encounter. Is the login button going to always spin infinity, and you unable to login?
from plugin-email.
Hi @bishoy-magdy, thank you for your response!
Is the login button going to always spin infinity, and you unable to login?
Yes, when I click on the Login button, then it changes to a Loading spinner that spins infinitely, and I am unable to login.
from plugin-email.
Related Issues (17)
- Problem with +tag in the title when using fetching from a mailbox HOT 4
- Add e-mail provider "Strato.de" HOT 5
- eml-upload: Message body not in note HOT 3
- eml upload: No sender information in note HOT 1
- mbox format? HOT 1
- Login not possible HOT 5
- Plain text only email not importing HOT 1
- Manual login requiring an @ in the login name HOT 5
- activity display that is always visible HOT 5
- Attachments not being retrieved HOT 2
- Stuck on 'Loading' HOT 3
- No email body when sent from various email clients
- No emails processed with newer versions of Joplin HOT 4
- New release? HOT 2
- Gmail Invalid Credentials HOT 1
- JPL binary of current codebase
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-email.