"Midnight" reference returning Error

I have a rule that i’ve created that uses the every: specific: reference: Midnight, offset ... trigger and when trying to submit the rule to the api (via create or update) it returns an “unrecoverable error”. However, when I update it to use a reference of “Noon” with a different offset for the same time, it works perfectly fine. Has anyone else noticed an issue when using the “Midnight” reference?

Here is what errors out -

           "every": {
                "specific": {
                    "reference": "Midnight",
                    "offset": {
                        "value": {
                            "integer": -30
                        },
                        "unit": "Minute"
                    }
                },
                "actions": [ ...

Here is what works without issue -

            "every": {
                "specific": {
                    "reference": "Noon",
                    "offset": {
                        "value": {
                            "integer": 690
                        },
                        "unit": "Minute"
                    }
                },
                "actions": [ ...

I found Midnight to be a curious choice of reference by ST given the ambiguity. It is about half-seven in the evening here. Was Midnight nineteen and a half hours ago or is it in four and a half hours? I’ve never bothered to find out and just use Noon to save thinking about it.

There is something about times only being between 0 and 83999 but the explanation is as clear as mud. That might suggest Midnight is 0 with a positive or zero offset, and 86400 with a negative offset. Or maybe not. Maybe it can’t have a negative offset.

That was exactly what I was wondering. If the -30 is what broke it due to it not working both ways.

Hi, @mzp

Let me check this with the team and get back to you.

1 Like

Hello, everyone

I have been discussing this with the team. There is something that is not working well when combining the reference Midnight with negative offsets since it is interpreted as a time in the past (which is not allowed), therefore the A non-recoverable error condition occurred. message. I already reported this error, but I can’t promise a fix in the near future, since they are currently pretty busy, and this issue can be easily bypassed. I will recommend, as a general rule, to avoid using negative offsets if possible.

1 Like