maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   Bug in the Mail App when new mails have arrived? (PR1.3) (https://talk.maemo.org/showthread.php?t=85271)

Hacker 2012-08-20 18:43

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
My Yahoo account is IMAP, too. And the trigger approach is mostly working, there is just some variability.Today, it has worked well, for instance, but over the weekend, there were several times when it didn't work. I don't know the pattern of when it works and when it doesn't.

Arthuro_Adam 2012-08-20 21:14

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Anybody about my installation problem:

"Now, I can install the repo, but can't install sqlite3, because some packages can't authenticated. I install with root. Any suggestions?

I ran terminal:

"devel-su"

then

"apt-get install sqlite3"

Shinto 2012-08-20 23:12

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Adam, is there any way I could see your terminal output? It could be a screenshot of the N9 itself (ScreenshotMee on the Ovi store is good for this) or a screenshot from your computer, if you're connecting that way. The contents of /etc/apt/sources.list.d/harmattan-dev.list might be helpful to see, too.

Arthuro_Adam 2012-08-21 06:04

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Quote:

Originally Posted by Shinto (Post 1253936)
Adam, is there any way I could see your terminal output? It could be a screenshot of the N9 itself (ScreenshotMee on the Ovi store is good for this) or a screenshot from your computer, if you're connecting that way. The contents of /etc/apt/sources.list.d/harmattan-dev.list might be helpful to see, too.

Thanks for your help, but finally, I could manage to install sqlite3. I downloaded sqlite3.deb from harmattan.dev.nokia.com, I tried to install, but during the install it was missing some dependencies. After that I tried to install that dependencies, and the Terminal suggest to use "apt-get -f install" command and that was the solution, it installed it.

Then I tried the code to refresh my mails read/unread count and it's refreshed :) but I don't know the result, because I have more than 6k mails and the "mark all read" function not working :)

Any terminal command to mark all mail read?

Thanks.

Adam

Shinto 2012-08-21 17:37

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Quote:

Originally Posted by Hacker
Today, it has worked well, for instance, but over the weekend, there were several times when it didn't work. I don't know the pattern of when it works and when it doesn't.

As far as I can tell, and from my experience, the trigger will always work, just not right away. If your new-mail notification goes off and you immediately open the e-mail application, you probably won't see the blue circles. If you wait a while, perhaps another e-mail update cycle or two, they'll probably be there.

I'm guessing this is due to the write-ahead-log DB checkpoints, and my attempts to force quicker updates (through PRAGMA wal_autocheckpoint) don't seem to stick. So without a true code fix, I'm afraid this may be as good as it gets.

Quote:

Originally Posted by Arthuro_Adam (Post 1254009)
Any terminal command to mark all mail read?

Yes, by running an UPDATE command in sqlite3. This is what such an operation would look like:

Code:

~ $ /usr/bin/sqlite3 /home/user/.qmf/database/qmailstore.db
SQLite version 3.7.7 2011-06-23 19:49:22             
Enter ".help" for instructions                       
Enter SQL statements terminated with a ";"           
sqlite> UPDATE mailmessages SET status=19137 WHERE status IN (18496,18497);
sqlite> .quit
~ $


Arthuro_Adam 2012-08-21 20:59

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Quote:

Originally Posted by Shinto (Post 1254236)
As far as I can tell, and from my experience, the trigger will always work, just not right away. If your new-mail notification goes off and you immediately open the e-mail application, you probably won't see the blue circles. If you wait a while, perhaps another e-mail update cycle or two, they'll probably be there.

I'm guessing this is due to the write-ahead-log DB checkpoints, and my attempts to force quicker updates (through PRAGMA wal_autocheckpoint) don't seem to stick. So without a true code fix, I'm afraid this may be as good as it gets.



Yes, by running an UPDATE command in sqlite3. This is what such an operation would look like:

Code:

~ $ /usr/bin/sqlite3 /home/user/.qmf/database/qmailstore.db
SQLite version 3.7.7 2011-06-23 19:49:22             
Enter ".help" for instructions                       
Enter SQL statements terminated with a ";"           
sqlite> UPDATE mailmessages SET status=19137 WHERE status IN (18496,18497);
sqlite> .quit
~ $


Thanks, I did it, but it didn't work, I have the same 4k unread mails :(

yam603 2012-11-23 12:11

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Are there any news for solving this bug?

thanks
yam603

czajniczeq 2013-01-07 22:49

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Ok this solution with trigger is quite great but the problem is that some unread mail got status 18496 or 2048 or even 51264 and for all them the blue circle don't work. I checked with my gmail account in which everything is ok the unread mail status there is set to 2049. So the best solution would be to change all of that codes to 2049 or 18497 but the question is why unread messages have different status codes. If we change them I suppose we loose some maybe quite important information. So if anyone could found a description of status codes in fenix mail it would be great help and possible lead to solving this problem.

greenstorm 2013-10-02 12:40

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Some problem with me here - I have unread mail, and for two of three mail accounts I can mark all mails as read. Just for my account with 4.4xx unread mails it doesn't work.

nemric 2014-05-16 08:32

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Hi,

I think I have a better way to resolve this issue. I'm working on it but will need help to make it as simple and fast as possible.
Here is the results I've found.

In database there's a table named : Mailstatusflags
This table is used to create mailmessages.status value

that's why you can have values like
Quote:

Originally Posted by czajniczeq
18496 or 2048 or even 51264

this number is composed with mailstatusflags.bitstatus

The flag were looking for is "incoming" : bitstatus = 1
Statusbit = 8 : "READ"
Statusbit = 12 : "NEW"

18496 = 0100 1000 0100 0000 mean :
1st bit = 0 = not "incoming"
7th bit = 1 = "contentavailable"
12th bit = 1 = "new"
15th bit = 1 = "partialcontentavailable"

2048 = 1000 000 000
12th bit = 1 = "new"

51264 = 0001 0100 1001 000
= repliedall, read, unloadeddata, readreplyrequested
@czajniczeq, I don't think this message should be count as unread !?!

and so on ...

What I'm looking for now is the best way to create a trigger "on before insert" that set 1st bit to 1 (18496 +1, 2048+1) when message is new : 12th bit = 1

I think this will resolve for a long time and in a reliable way this little bug !

regards.

nemric 2014-05-16 15:44

Re: Bug in the Mail App when new mails have arrived? (PR1.3)
 
Hi,

As I test my theory on a duplicate db, I have to install sqlite3 ... but on test DB it seems to work properly !
here is the trigger :
Code:

CREATE TRIGGER UpdateIncommingBit
      AFTER INSERT ON mailmessages
      FOR EACH ROW
      WHEN 1|new.status <> new.status
AND
128|new.status <> new.status
AND
2048|new.status = new.status
BEGIN
    UPDATE mailmessages
      SET status = 1|status
    WHERE id = new.id;
END;

How to read it ?
cf : http://www.tutorialspoint.com/sqlite..._operators.htm

So I use bitwise opérator | to check if mail is read 128|new.status
"read" status is bitstatus 8 in mailstatusfalg table, bin 1000 0000 = dec 128
"new" status is bitstatus 12, bin 1000 0000 0000 = dec 2048
and so on (use windows calc in developper mode, option Dword, Déc) ...

so

1|new.status <> new.status = not "incoming" status
AND
128|new.status <> new.status = not "read" status
AND
2048|new.status = new.status = "new" status

if it's ok :

SET status = 1|status

my test process :

Code:

insert into mailmessages (id,type,parentfolderid,
previousparentfolderid,sender,
recipients,subject,stamp,status,parentaccountid,frommailbox,
mailfile,serveruid,size,contenttype,responseid,responsetype,
receivedstamp,copyserveruid,
restorefolderid,listid,rfcid,preview,parentthreadid)

values
(1500,8,14,0,'test0','test','test','2014-05-15',18496,8,'','','',123,4,0,0,'2014-05/15','',0,'','','',2016)

and with

Code:

values
(1501,8,14,0,'test1','test','test','2014-05-15',2048,8,'','','',123,4,0,0,'2014-05/15','',0,'','','',2016)

a select on these 2 records will return status 18497 and 2049

So now i just have to install sqlite3 and this trigger on y N9 and restart my own mail server (down since I change house) that produced this bug.

Let me know if it works for you ... I'll let you know as soon as possible :)

...


All times are GMT. The time now is 19:15.

vBulletin® Version 3.8.8