~rjarry/aerc#136: 
replace triggers with a hooks system

This ticket is to track the progress of removing the trigger-system in favour of a more comprehensive hooks system. Hooks that have been suggested are:

Hook triggered when Status
message-received a mail is received
flag-changed a message's flags have been modified
mesage-moved a message has been moved ✅ (mail-{added,deleted})
message-copied a message has been copied ✅ (mail-{added,deleted})
message-deleted a message has been deleted
message-post-compose a message's content has been edited
message-postponed a message has been postponed
message-sent a message has been sent
folder-created a folder/inbox is created
folder-moved a folder/inbox is renamed/moved
folder-deleted a folder/inbox is deleted
aerc-startup aerc is starting
aerc-shutdown aerc is quit
tag-modified a notmuch tag is added/removed

Discussion on aerc-discuss

Suggested-by: ~ferdinandyb

Status
REPORTED
Submitter
~poldi1405
Assigned to
Submitted
1 year, 9 months ago
Updated
5 months ago
Labels
feature wip

~poldi1405 1 year, 9 months ago

This requires a completely different system from triggers. To avoid keeping two ways of doing it, triggers will be deprecated as soon as the message-received hook has been implemented.

~rjarry 1 year, 9 months ago

There are no arguments for actually "replacing" triggers with hooks. Simply adding more triggers would be less disruptive as you will not need to deprecate anything. The current only new-email trigger can remain and you can add all these new ones. The triggers already allow running shell commands.

~rjarry closed duplicate ticket #139 1 year, 9 months ago

~rjarry REPORTED IMPLEMENTED 1 year, 8 months ago

Moritz Poldrack referenced this ticket in commit 2fef0f4.

~rjarry 1 year, 8 months ago

Moritz Poldrack referenced this ticket in commit f10b184.

~rjarry 1 year, 8 months ago

Moritz Poldrack referenced this ticket in commit b46b2d2.

~poldi1405 IMPLEMENTED REPORTED 1 year, 7 months ago

~rjarry 1 year, 30 days ago

Jason Cox referenced this ticket in commit 31b50f2.

~rjarry 1 year, 30 days ago

Jason Cox referenced this ticket in commit faa879f.

~rjarry 10 months ago

Moritz Poldrack referenced this ticket in commit 0e592b2.

~ferdinandyb 10 months ago

~mpldr is this still a breaking feature? Not any more right?

~poldi1405 10 months ago

No, the only thing that was breaking is over.

-- Moritz Poldrack https://moritz.sh

Printed on recycled paper.

~rjarry 7 months ago

Bence Ferdinandy referenced this ticket in commit cee5d5a.

~rjarry 7 months ago

Bence Ferdinandy referenced this ticket in commit 939000c.

~ferdinandyb 6 months ago

setting something like

mail-added = sleep 120
mail-deleted = sleep 120

and then archiving two emails will completely block aerc for a very long time

~mpldr 6 months ago

#This is by design, if something should run asynchronously, that should be made explicit to avoid undefined behavior. We should probably document this.

Moritz Poldrack https://moritz.sh

Used with permission.

~ferdinandyb 6 months ago

actually setting sleep 1 is also pretty bad. We should at least update our examples, but much better would be imho to offer async hook execution

~mpldr 6 months ago

That would be a race condition in itself. see also: aerc-shutdown

#How would this run async and be unracy?

Moritz Poldrack https://moritz.sh

Available while quantities last.

~ferdinandyb 6 months ago

Yes, we should definitely document this, and also change the examples, since right now we have an example running mbsync on a folder synchronously, and I doubt that's a sane choice for anyone.

Register here or Log in to comment, or comment via email.