D15975: Remove just deleted POP3 messages from the internal maps

Krzysztof Nowicki noreply at phabricator.kde.org
Fri Oct 5 21:51:01 BST 2018


nowicki created this revision.
nowicki added a reviewer: KDE PIM.
nowicki added a project: KDE PIM.
Herald added a subscriber: kde-pim.
nowicki requested review of this revision.

REVISION SUMMARY
  This is to prevent attempts to delete them again.
  
  Fixes the testCountBasedLeaveRule, which exercises the following scenario:
  
  - initial state: 3 messages known
  - two new messages are added on server
  - LIST returns 5 messages
  - UIDL returns 5 UIDs, 2 of them new
  - download of 2 messages starts
  - fetch of first message is completed
  - item create for first message is completed
  - item create completion triggers cleanup of unwanted server messages
  - messages 1 and 3 are deleted as they are the oldest
  - fetch of second message is completed
  - item create for second message is completed
  - item create completion triggers cleanup of unwanted server messages
  - messages 1 and 3 are deleted again - this causes the test to fail
  
  Removing those identifiers causes the second search for items to delete to return an empty set and no further delete attempts are made.
  
  To be honest I have mixed feelings about this as having looked deeper at the code I think this should be fixed in a different way:
  
  1. POP3Resource::shouldDeleteId() should be modified so that when it receives a concrete id (i.e. != -1) it should only return either this id as the one to be deleted or return an empty set. Today when "leave on server" is set it always consider all messages and return a full list of messages to be deleted.
  2. After the item creation step is completed (Download & Save states) the CheckRemovingMessage should be triggered to clean-up all unwanted messages from the server.
  
  Implementing #1 is simple, however doing it causes unwanted messages never to be deleted from the server. Implementing #2 is beyond my knowledge of the POP3 resource as it involves changes to the state machine.

TEST PLAN
  Run pop3test

REPOSITORY
  R44 KDE PIM Runtime

REVISION DETAIL
  https://phabricator.kde.org/D15975

AFFECTED FILES
  resources/pop3/pop3resource.cpp

To: nowicki, #kde_pim
Cc: kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20181005/9482c940/attachment.html>


More information about the kde-pim mailing list