Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option --all of tagging commands should apply to matched messages only #1643

Open
guludo opened this issue Jan 12, 2024 · 7 comments
Open

Option --all of tagging commands should apply to matched messages only #1643

guludo opened this issue Jan 12, 2024 · 7 comments

Comments

@guludo
Copy link
Contributor

guludo commented Jan 12, 2024

Is your feature request related to a problem? Please describe.
Currently the option --all redoes the query to apply modifications to the tags. This could be problematic in the following scenario:

  1. User does a search;
  2. New email(s) that would match the user's query arrive but the user hasn't refreshed the search buffer yet;
  3. User decides to use some tagging command with --all (e.g. untag --all inbox,unread);
  4. We end up applying the modifications to the new email(s) from (2) from behind the user's back.

Describe the solution you'd like
IMO, we should apply the modifications to only the currently matched messages.

@pazz
Copy link
Owner

pazz commented Jan 12, 2024 via email

@guludo
Copy link
Contributor Author

guludo commented Jan 12, 2024

Yeah, that would require some partial re-implementation, we would need to keep the set of matched msgids for this.

So, is this a wontfix?

@pazz
Copy link
Owner

pazz commented Jan 15, 2024 via email

@lucc
Copy link
Collaborator

lucc commented Jan 15, 2024

Can we fix this specific problem (with new mail arriving) by appending a date:..when_the_original_query_was_executed to the tag/untag query?

@guludo
Copy link
Contributor Author

guludo commented Jan 15, 2024

Can we fix this specific problem (with new mail arriving) by appending a date:..when_the_original_query_was_executed to the tag/untag query?

From man notmuch-search-terms, the date: prefix is for the Date: header, so I'm afraid that wouldn't really work.

@guludo
Copy link
Contributor Author

guludo commented Jan 15, 2024

I suppose it is a wontfix, yes. The thing is that the set of matched IDs can be huge. Just search for * and you get all messages, which can take up lots of space and is very inefficient to store explicitly, however you do this. Quoting Gustavo José de Sousa (2024-01-12 17:56:23)

Yeah, that would require some partial re-implementation, we would need to keep the set of matched msgids for this. So, is this a wontfix? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: <pazz/alot/issues/ @.**>

I see your point.

Well, in the common use case, I would expect searches that are interesting to the user not to return a huge among of results. Thinking about that, maybe we could have an --all-matched option that would only work if the current search did not reach a certain limit of matched messages? Otherwise it could bail out with an error message.

I think a limit of 1000 messages would be a reasonable one: extrapolating to message ids of 100 bytes each, we would store about 98KiB of msgid content plus some overhead from the data structure.

Maybe this limit could also be a configurable value.

@pazz
Copy link
Owner

pazz commented Jan 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants