ability to purge duplicate documents for mailboxes
according to Fjodor reports on irc, there's some execution pathway that leads to unrecoverable state in the mailbox documents.
the relevant backtrace is this one:
2017-04-20T20:21:50+0200 [twisted.internet.defer#critical] Unhandled error in Deferred:
2017-04-20T20:21:50+0200 [twisted.internet.defer#critical]
Traceback (most recent call last):
File "/home/sune/src/pixelated/bitmask-dev/venv/local/lib/python2.7/site-packages/twisted/internet/base.py", line 1252, in mainLoop
self.runUntilCurrent()
File "/home/sune/src/pixelated/bitmask-dev/venv/local/lib/python2.7/site-packages/twisted/internet/base.py", line 851, in runUntilCurrent
f(*a, **kw)
File "/home/sune/src/pixelated/bitmask-dev/venv/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 459, in callback
self._startRunCallbacks(result)
File "/home/sune/src/pixelated/bitmask-dev/venv/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 567, in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "/home/sune/src/pixelated/bitmask-dev/venv/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/home/sune/src/pixelated/bitmask-dev/src/leap/bitmask/mail/adaptors/soledad.py", line 267, in get_first_doc_if_any
raise DuplicatedDocumentError
leap.bitmask.mail.adaptors.soledad.DuplicatedDocumentError:
the following should help to reproduce the error:
< Fjodor> kaliy: What would it take to make some recovery code that I could use to purge the folders that are duplicated?
< Fjodor> kaliy: And what I did was to create a subfolder of inbox, create a subfolder of that, attempt to copy some emails from another account to that, realise failure, delete the outermost subfolder, and create again...