Giter Site home page Giter Site logo

Comments (5)

chopstik avatar chopstik commented on July 30, 2024 1

@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.

founfabug avatar founfabug commented on July 30, 2024 1

@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.

adeverteuil avatar adeverteuil commented on July 30, 2024

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:

joplinFolders = await joplin.data.get(['folders']);

joplinFolders = await joplin.data.get(['folders']);

References:

from plugin-email.

bishoy-magdy avatar bishoy-magdy commented on July 30, 2024

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.

adeverteuil avatar adeverteuil commented on July 30, 2024

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.

Here is a screenshot:
Screenshot 2023-06-19 12-50-07 loading

from plugin-email.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.