Hi Gabriel,

On Mon, Aug 12 2019, Gabriel Filion wrote:
> On 2019-08-12 10:43 a.m., Gabriel Filion wrote:
>> It seems to me that some folks reported in this issue being able to
>> stop the influx of emails by chaning the "format" option where
>> edgetrigger is set. Did you try applying this solution?
>
> woops! sorry for the imprecision. it's actually the "pattern"
> option. (I read the upstream issue this week-end but couldn't reply
> until today so there was a mix bowl of salad in my head instead of a
> brain)

Sorry for not being clear, but I when I wrote "I have too many Alerts
defined ... with edgetrigger to reorganize and double the Alerts into
separate ==0%,==0%,==100% + ==100%,==0%,==0% [pattern] non-edgetrigger
variants", I was writing about the proposed work-around using the
"pattern" option.

I didn't try it.  It would probably work.  At one installation I have 20
alerts defined using edgetrigger (connected to 120 targets), this would
turn into 40 if I were to use the alternating patterns instead (and
having to update the 120 targets to use the new pairs).  I could do
that, however I'd also lose the lovely raised/cleared subject text which
I have IMAP sieve filters parsing.

Perhaps another way to patch this bug is to sort of cast $prevmatch into
a boolean in the alert checking logic:

  sub check_alerts {
    ...
    if ($edgetrigger and $prevmatch != $match) {
      $what = ($prevmatch == 0 ? "was raised" : "was cleared");
    }

Something like:

  sub check_alerts {
    ...
    if ($edgetrigger and ($prevmatch_bool == 0 ? 0 : 1) != $match) {
      $what = ($prevmatch_bool == 0 ? "was raised" : "was cleared");
    }

I didn't try it because I have a sense that restoring edgetrigger
functionality isn't going to be that simple (i.e. those thousands of
emails were all mistakenly all labeled "was cleared" without any initial
"was raised").

If it would make upstreaming the patch easier, I'll work at it.

Thanks!

-- 
Gerald Turner <gtur...@unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D

Attachment: signature.asc
Description: PGP signature

Reply via email to