-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Never got to a result #394
Comments
Hi,
|
@tfederici Any news on this? |
The issue is still there like it was in my first message, and Thirdstats has never worked so far |
Ok, let's see
This is unfortunately a very meaningless message. But maybe we can narrow down the issue, like we did in this thread. Please paste the following snippet in your console: let accounts = await messenger.accounts.list(); let allfolders = [];
accounts.map(a => { function traverse(folders) { if (!folders) return; for (let f of folders) { allfolders.push(f); traverse(f.subFolders); }} traverse(a.folders);})
console.log(allfolders); This should print a list of all folders of all accounts. Does this throw any error messages? |
Ok, now that we know, that the folder list can by correctly retrieved, let's take it a step further and count all messages of all folders of all accounts. Please run the following snippet, if you have the console still open: let count = 0;
await Promise.all(allfolders.map(async f => { console.log(f); let page = await messenger.messages.list(f); page.messages.map(m => count++); while (page.id) { page = await messenger.messages.continueList(page.id); page.messages.map(m => count++); } })).then(() => { console.log(count); }); If you have a new console, here is the full code snippet: let accounts = await messenger.accounts.list(); let allfolders = []; let count = 0;
accounts.map(a => { function traverse(folders) { if (!folders) return; for (let f of folders) { allfolders.push(f); traverse(f.subFolders); }} traverse(a.folders);})
await Promise.all(allfolders.map(async f => { console.log(f); let page = await messenger.messages.list(f); page.messages.map(m => count++); while (page.id) { page = await messenger.messages.continueList(page.id); page.messages.map(m => count++); } })).then(() => { console.log(count); }); The output can take some time, according to the number of messages you have. Please let me know, if you now have any error messages. The last folder that is displayed should be the one causing trouble. |
Can you do it once again with the snippet above? I edited it after posting and added a console statement to find the folder causing trouble... (sorry for that) |
Interesting, it seems to be possible to iterate over all folders, but then there is an issue processing the results 🤔 I modified the snippet slightly, maybe this gives us a better error message. Same console: count = 0;
await Promise.all(allfolders.map(async f => { console.log(f); let page = await messenger.messages.list(f); page.messages.map(m => count++); while (page.id) { page = await messenger.messages.continueList(page.id); page.messages.map(m => count++); } })).then(() => { console.log(count); }).catch((error) => { console.error(error.message); }); New console: let accounts = await messenger.accounts.list(); let allfolders = []; let count = 0;
accounts.map(a => { function traverse(folders) { if (!folders) return; for (let f of folders) { allfolders.push(f); traverse(f.subFolders); }} traverse(a.folders);})
await Promise.all(allfolders.map(async f => { console.log(f); let page = await messenger.messages.list(f); page.messages.map(m => count++); while (page.id) { page = await messenger.messages.continueList(page.id); page.messages.map(m => count++); } })).then(() => { console.log(count); }).catch((error) => { console.error(error.message); }); |
That's indeed unfortunate. I'm afraid I cannot do anything to solve this, since it seems to be a problem with Thunderbird itself. I created a corresponding thread in Thunderbirds topicbox, let's hope somebody can help here. |
Thank you Andreas for your support |
@tfederici Do you use any virtual folders (see topicbox thread)? I extended the snippet once more with a try/catch block for the messages list declaration: let accounts = await messenger.accounts.list(); let allfolders = []; let count = 0;
accounts.map(a => { function traverse(folders) { if (!folders) return; for (let f of folders) { allfolders.push(f); traverse(f.subFolders); }} traverse(a.folders);})
await Promise.all(allfolders.map(async f => { console.log(f); try { let page = await messenger.messages.list(f); page.messages.map(m => count++); while (page.id) { page = await messenger.messages.continueList(page.id); page.messages.map(m => count++); } } catch(error) { console.error(error); } })).then(() => { console.log(count); }).catch((error) => { console.error(error.message); }); Does this bring any useful error message? |
Hard to say, since I don't know, which email provider you have. Virtual folders are all folders, that are "generated" (e.g. folders for filter or search results, unified inboxes or similar).
Nice! That means we have found a way to work around the issue (which we cannot solve). I will soon (hopefully in the next couple of days) provide a patch update for ThirdStats. With that, you should be able to see at least stats for 83412 messages (which I assume are not all). |
great! even if I think to have many more messages stored together with several other "normal" accounts, I have one gmail (that of my university) and two outlook acounts (other universities) |
I can only guess, but I think the folders itself can be retrieved (name, location), but their content cannot be read / processed by Thunderbirds webextension APIs. This time there are hundreds of error messages, because I added a try/catch block for each attempt to read paginated folder content. This is also why there is an actual result now, because those error throwing pages are not blocking the overall message retrieval anymore. |
I see, but is that an issue? This should match the accounts / folders you see in your Thunderbird. Every account has e.g. an inbox or a trash folder. |
not at all, rather it's a clue that the so-called virtual folders, even though not usually visible, are there btw, I've observed by chance a strange thing: |
I see. Thanks for the additional information, will take that into account. Haven't had time to provide a patch yet. |
I added the patch now. If you like, you can try the latest build and test, if stats are (at least partially) shown to you. I will release a new ThirdStats version, as soon as you confirmed that it works. |
Thats great 👍🏻 Thank you for the screenshot.
|
Hi Andreas, I'm answering below by point: |
|
Thank you for this additional report. Since this is another issue, I added #405 for further discussion. |
Hi, I installed ThirdStats more than 3 years ago because it looked really useful for me
since then, I've tried dozens and dozens of times, even with different machines, it never got to provide any kind of result
I left it working for days, I chose a single account and a single folder, a short time period, whatever, but never succeeded
the tool starts and it looks to idle when approaching around 80% of advancement on the top bar
never got any error message
this is my usual configuration (I tried also others)
System (please complete the following information):
thank you for your support
tommaso
The text was updated successfully, but these errors were encountered: