login about faq

In the latest version of my email archiving app I've changed most Chilkat related code to the async methods. I've now got 2 error reports from testers that this sometimes doesn't work. The code does 2 passes: first a header is downloaded. The message ID is checked if it's already in the database. If it's not then the full mail is downloaded with the following code:

dim messageID as Integer = CkoMessageSet.getID(counter - 1)
CkoMailTask = CkoImap.FetchSingleAsMimeAsync(messageID, True)
call CkoMailTask.run
While CkoMailTask.Finished <> true
  CkoMailTask.SleepMs(50)
wend

if not CkoMailTask.TaskSuccess then
  Globals.theErrorLog.LogItem(CurrentMethodName + " " + MailboxPath +  " task didn't finish")
  Return ""
end if

dim theBody as String = CkoMailTask.GetResultString
if theBody = "" then
  globals.theErrorLog.LogItem(CurrentMethodName + " " + MailboxPath +  " wasn't able to load result from task")
  globals.theErrorLog.LogItem(CurrentMethodName + " " + MailboxPath +  setLastErrorForTask(CkoMailTask))
end if

And now the relevant part of the error log when the mail body is empty:

2017-08-25, 9:52:10 AM ImapIterator.GetNumberOfObjects INBOX 25517
2017-08-25, 12:57:58 PM ImapController.getMail INBOX wasn't able to load result from task
2017-08-25, 12:57:58 PM ImapController.getMail INBOXChilkatLog:
  FetchSingleAsMime:
    DllDate: May 25 2017
    ChilkatVersion: 9.5.0.68
    UnlockPrefix: xxx
    Architecture: Little Endian; 32-bit
    Language: MAC OS X C/C++
    VerboseLogging: 0
    msgId: 236230
    bUid: 1
    fetchSingleComplete:
      autoDownloadAttachments: 1
    --fetchSingleComplete
    Success.
  --FetchSingleAsMime
--ChilkatLog

Xojo 2017r1, macOS 10.12.6.

Is this a problem or can I ignore the mail?

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com Mail Archiver X: The email archiving solution for professionals

asked Aug 28 at 00:49

bwill's gravatar image

bwill
357

edited Aug 28 at 06:57

jpbro's gravatar image

jpbro ♦
1.1k2618


12next page »

link

answered Sep 10 at 21:35

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

What a simple error. Thanks! Outstanding service.

Regards

Beatrix Willius

link

answered Sep 11 at 06:09

bwill's gravatar image

bwill
357

My first comment is to urge any developer NOT to use async just for the sake of using async. One should only use async to allow your main thread of execution to do other things while the async operation is underway.

This usage of async is just a more complicated/convoluted (and expensive) way of duplicating the synchronous method call:

CkoMailTask = CkoImap.FetchSingleAsMimeAsync(messageID, True)
call CkoMailTask.run
While CkoMailTask.Finished <> true
  CkoMailTask.SleepMs(50)
wend

In other words, the async here is pointless. It's entirely equivalent to just calling CkoImap.FetchSingleAsMime.

link

answered Aug 28 at 09:40

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

Of course, I don't use async just for the sake of using async. When using async there is no longer the spinning pizza of death when downloading a large email. Even in a thread I saw this often when using FetchSingleAsMime. Now with the async method this is gone and I really don't want to go back.

Regards

Beatrix Willius

link

answered Aug 28 at 09:48

bwill's gravatar image

bwill
357

Thanks Beatrix. :)

(Aug 28 at 09:49) chilkat ♦♦

PS> I'm looking into the problem..

link

answered Aug 28 at 09:48

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

Grin... not even sure if it's a problem. Just want to make sure that I don't omit a mail since I've now gotten this from 2 users.

Regards

Beatrix Willius

link

answered Aug 28 at 09:50

bwill's gravatar image

bwill
357

Beatrix, re-run with VerboseLogging turned on, and then see what the LastErrorText contains. (Set the CkoImap.VerboseLogging property = YES.

My initial suspicion is that it's somehow a character encoding issue. (If you know, how large is the email in question?) If, for example, the raw bytes of the email are received, and somehow the information about what character encoding is used (i.e. should the bytes be interpreted as utf-8, utf-16, iso-8859-1, etc.?) .. if Chilkat interprets the bytes with a wrong encoding, then the result could be empty. (Because to properly return a string to your Objective-C code requires a conversion to utf-8 from whatever byte representation is received from the server..

link

answered Aug 28 at 10:03

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

link

answered Aug 28 at 12:21

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

I've asked the users to do the logging - haven't heard back from them, yet. I would need the Xojo plugin and not the Obj-C one.

Regards

Beatrix Willius

link

answered Aug 28 at 12:23

bwill's gravatar image

bwill
357

Here's the new v9.5.0.69 release: https://www.chilkatsoft.com/xojo.asp

Please let me know if that resolves anything..

link

answered Aug 31 at 18:30

chilkat's gravatar image

chilkat ♦♦
12.8k317366476

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×22

Asked: Aug 28 at 00:49

Seen: 440 times

Last updated: Sep 18 at 11:50

powered by OSQA