about summary refs log tree commit homepage
path: root/t/lei-q-save.t
DateCommit message (Collapse)
2021-09-21lei q: update messages to reflect --save default
I wanted to try --dedupe=none for something, but it failed since I forgot --no-save :x So hint users towards --no-save if necessary.
2021-09-11lei: fix handling of broken lei.saved-search config files
lei shouldn't become unusable if a config file is invalid. Instead, show the "git config" stderr and attempt to continue gracefully. Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://public-inbox.org/meta/20210910141157.6u5adehpx7wftkor@meerkat.local/
2021-09-08lei q|up: fix write counter for v2
It's a bit confusing to see "0 written to ..." when we actually wrote something.
2021-08-19lei q: make --save the default
Since "lei up" is more often useful than not and incurs neglible overhead; enable --save by default and allow --no-save to work. This also fixes a long-standing when overwriting --output destinations with saved searches: dedupe data from previous searches are reset and no longer influences the new (changed) search, so results no longer go missing if two sequential invocations of "lei q --save" point to the same --output.
2021-08-11lei_saved_search: canonicalized relative save paths
Storing relative paths with '..' in them can be expensive to resolve when running 'lei up', so prefer storing canonicalized absolute paths. We only do this for paths with '..' in them, though, since this can lose symlink info.
2021-07-25t/lei*: check error messages on failures
I just hit an unreproducible failure in t/lei-p2q.t and lacked $lei_err information to diagnose it. Hopefully this helps track down odd failures in the future.
2021-06-09lei edit-search: fix and add a (weak) test
This broke recently and lacked an automated test, so rely on EDITOR=cat to ensure we have some coverage. Fixes: d2670108f71b1eff ("pkt_op: make pkt_do an OO method")
2021-05-28lei q|up: support v2:/path/to/inboxdir destination
This allows "lei-managed pseudo mailing lists" as described by Konstantin. Alternates use is optional and can be enables via --shared. This doesn't manage or edit ~/.public-inbox/config; presumably there'll need to be some tweaking of search parameters before finalizing and making the inbox publicly accessible via HTTP/NNTP. Link: https://public-inbox.org/meta/20210426164454.5zd5kgugfhfwfkpo@nitro.local/T/
2021-05-28t/lei-*: better diagnostics for occasional failures
Some of these have been failing occasionally, not sure how, yet...
2021-05-23lei <q|up>: set \Recent on non-empty mbox and Maildir
Despite JMAP not supporting the equivalent of the IMAP \Recent flag, it is useful for "lei q --augment", and "lei up" users to be able to distinguish new results from old-but-unread messages in an mbox or Maildir. For mbox family messages, we'll drop the "O" status flag when appending to mboxes, and we'll write to the "new" subdirectory of Maildirs. Behavior when writing to initially empty Maildirs and mboxes remains unchanged since there's no need to distinguish between new and old results in the initial case. Having users wait for a rename(2) storm or complete mbox rewrite hurts UX. With IMAP mailboxes, \Recent is already enforced by the IMAP server and IMAP clients have no way of changing it(*) (*) mutt uses the "Old" IMAP flag which isn't part of RFC 3501, other MUAs may do similar things.
2021-05-06lei_mail_sync: Maildir canonicalization omits trailing slash
We use trailing slashes internally, but should not increase visual noise for users by exposing them in config files or DB storage (and shell completion/listings). This fixes a long-standing bug in $lei->rel2abs that prevented absolute paths from being canonicalized.
2021-04-28tests: restore CWD with "lei -C" and run_script
This simplifies test_lei users in t/*.t
2021-04-23lei up: support symlinked pathnames
On my default FreeBSD 11.x system, "/home" is a symlink to "/usr/home", which causes "lei up" path resolution to fail when I use outputs in $HOME. Fall back to a slow path of globbing and matching pathnames based on st_ino+st_dev.
2021-04-23lei: saved searches support --dedupe=<mid|oid>
This is less surprising in case users are used to using --dedupe= without --save.
2021-04-20lei forget-search: new command to forget saved searches
Readers may lose interest in subscription topics. This lets them avoid clutter by forgetting a saved search. This does not and will not destroy the contents of an --output mailbox. In other words, this is similar to unsubscribing from an Atom/RSS feed or NNTP group. I've also decided we won't support 'mv-search', since it'll probably be rarely used and "lei convert" can be used, instead.
2021-04-20lei up: support --all=local
Users may wish to update several saved searches at once. We can support parallel updates in lei-daemon so users won't have to do it themselves via xargs or similar. Supporting IMAP outputs would be significantly more involved since we'd have to pre-authenticate for every single IMAP output before entering the redispatch loop.
2021-04-19lei q: --save and --augment may be combined
This necessitated fixing pause_dedupe to release the handle used by ->lock_for_scope_fast, but otherwise no changes to the LeiToMail package.
2021-04-19lei q: implement import-before default for --save
This makes "lei q --save" as safe as "lei q" to prevent against accidental data loss when clobbering an existing output,
2021-04-19lei: support unlinked/missing saved searches
It's conceivable a user will want to erase all previous results but still rerun/refresh a search to get new results. We probably won't support prune functionality, here, and instead require explicit removal of saved searches.
2021-04-18lei ls-search: command to list saved searches
Going forward, we'll probably support JSON for all the "ls-*" subcommands. This also provides the basis for "lei up" shell completion.
2021-04-17lei up: further improve Maildir canonicalization
We want to be able to use "lei up ." when inside a Maildir. We'll also relax Maildir/mbox basenames to be any non-'/' character after converting relative paths to absolute. The old restriction on allowed characters was unnecessary and made it impossible to reliably map "." when used as the sole argument for "lei up".
2021-04-17lei up: fix canonicalization of Maildirs
We always represent --output destination directories with a trailing slash to disambiguate directories from mbox filenames. Therefore, we must use the trailing slash when mapping the destination beck from the lei/saved-search/* directory. "lei up" now relies exclusively on the users --output pathname or URL for updates. This ought to be less confusing since pathnames in ~/.local/store/lei/saved-searches aren't ideal.
2021-04-17lei up: support output destination as arg
Specifying a directory in ~/.local/share/lei/saved-searches/ is painful, so support (and start encouraging) the use of the output.
2021-04-16lei q: --save preserves relative time queries
Somebody may want a saved search which consistently asks for messages within a rolling time period window. In other words, we want to support using "lei q --save dt:last.week.." and keeps the "dt:last.week.." relative to whenever "lei up" is run. This ensures relative date-time specifications get used in the future rather than converting into an absolute date-time from the initial "lei q" invocation.
2021-04-13lei: add "lei up" to complement "lei q --save"
The command isn't finalized, yet, but it's intended to update an existing saved search.
2021-04-13lei q: start wiring up saved search
This will have a over.sqlite3 for content-based deduplication. It may exhibit ibxish methods, so serving a read-only (or even R/W) IMAP or instance or displaying HTML isn't outside the realm of possibility.