Tier 1: robustness, speed, and maintainability #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tier1/robustness-and-maintainability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Housekeeping: all stale branches deleted (5 fully-merged dodo-era branches pruned).
This PR covers the high-ROI Tier 1 fixes from the maintainability review:
Robustness
_batches_pendingwiththreading.Lock, make worker long-lived (block onqueue.getforever instead oftimeout=30timeout that silently droppedbatch_done), emitbatch_doneafter every batch sonotmuch new+ UI refresh run per batch. Closes the flaky file-invisible-until-next-sync race.ThreadModel.refresh/refresh_messagenow storeerror_msgandthread.pyshows it viastatus_messageinstead of keeping stale data.SendmailThreadusescommunicate()to capture msmtp stderr, logs timeouts, reports real exception messages.msmtppath now usesshlex.split + shell=False; other shell commands (editor/file picker/browser) documented as intentional shell pipelines.Speed
notmuch.count_batch()usingnotmuch count --batch(one query per line on stdin) and use it inTagModel.refresh— two invocations total instead of2*Nsubprocesses. Tag browser goes from ~5s to ~0.1s for ~80 tags.Maintainability
lazarus/keys.py(key_string + keytabs),lazarus/html_utils.py(linkify/colorize/html2text),lazarus/mail_utils.py(message_parts/body/write_attachments).lazarus/util.pybecomes a thin re-export shim so existingfrom lazarus.util import Xand config examples keep working.No API or config breakage. Each commit is independently revertible.
python -m py_compilepasses.