Quick fix for #1081 #1096

Merged
g1itch merged 3 commits from ui-fixes into v0.6 2018-01-27 07:46:15 +01:00
g1itch commented 2018-01-25 13:43:03 +01:00 (Migrated from github.com)

With this oneliner "Mark all messages as read" works without error.

With this oneliner "Mark all messages as read" works without error.
PeterSurda commented 2018-01-25 14:02:23 +01:00 (Migrated from github.com)

perhaps it should be 998?

perhaps it should be 998?
PeterSurda commented 2018-01-25 14:04:26 +01:00 (Migrated from github.com)

or even better, can you check if sqlExecuteChunked in helper_sql works correctly and use that instead?

or even better, can you check if sqlExecuteChunked in helper_sql works correctly and use that instead?
g1itch commented 2018-01-25 14:07:43 +01:00 (Migrated from github.com)

If I understand correctly the objective is to take 999 items at a time, in this case the remainder from the division should be 0.

If I understand correctly the objective is to take 999 items at a time, in this case the remainder from the division should be 0.
g1itch commented 2018-01-25 14:08:06 +01:00 (Migrated from github.com)

OK, I'll try.

OK, I'll try.
PeterSurda commented 2018-01-25 14:08:29 +01:00 (Migrated from github.com)

i think if it's 0, it will execute the first chunk with just one item.

i think if it's 0, it will execute the first chunk with just one item.
g1itch commented 2018-01-25 17:54:37 +01:00 (Migrated from github.com)

I don't understand how sqlExecuteChunked() can work without modification of sqlStatement because it contains idCount placeholders.

        markread = sqlExecuteChunked(
            "UPDATE %s SET read = 1 WHERE ackdata IN(%s) AND read=0" % (
                'sent' if self.getCurrentFolder() == 'sent' else 'inbox',
                ','.join('?' * idCount)
            ),
            idCount, *msgids
        )
I don't understand how `sqlExecuteChunked()` can work without modification of `sqlStatement` because it contains `idCount` placeholders. ```python markread = sqlExecuteChunked( "UPDATE %s SET read = 1 WHERE ackdata IN(%s) AND read=0" % ( 'sent' if self.getCurrentFolder() == 'sent' else 'inbox', ','.join('?' * idCount) ), idCount, *msgids ) ```
PeterSurda commented 2018-01-25 18:02:52 +01:00 (Migrated from github.com)

You're right, I missed that one. It can probably be fixed by having a placeholder (e.g. {0}) in the original statement, and replacing it the way you just did but inside each of sqlExecuteChunked loops.

You're right, I missed that one. It can probably be fixed by having a placeholder (e.g. `{0}`) in the original statement, and replacing it the way you just did but inside each of `sqlExecuteChunked` loops.
g1itch commented 2018-01-25 22:10:37 +01:00 (Migrated from github.com)

It probably works, at least for me.

It probably works, at least for me.
g1itch commented 2018-01-25 22:27:57 +01:00 (Migrated from github.com)

I'll drop 0097ea6 If you test and approve this changes.

I'll drop 0097ea6 If you test and approve this changes.
PeterSurda commented 2018-01-25 22:32:09 +01:00 (Migrated from github.com)

Looks ok, I'll test it tomorrow and then merge.

Looks ok, I'll test it tomorrow and then merge.
This repo is archived. You cannot comment on pull requests.
No description provided.