Actions -> Runs history is not loading

Hi!

:computer: Environment
Defender v2, goerli testnet

:memo:Details
I'm testing a custom filter for a Monitor in goerli testnet, using Defender v2. I set the notification channel to email. I received an email stating th autotask / action run has failed. When I go to the link and redirected to the Action's Runs History panel, it keeps loading forever.

Is there another way of getting the error? Can I try the conditions locally?

:1234: Code to reproduce
Basic code:

exports.handler = async function(payload) {
  const conditionRequest = payload.request.body;
  const matches = [];
  const events = conditionRequest.events;
  for(const evt of events) {

 
    // metadata can be any JSON-marshalable object (or undefined)
    matches.push({
       hash: evt.hash,
       matchReasons: evt.matchReasons
       metadata: {
        "id": "customId",
        "timestamp": new Date().getTime(),
       }
    });
  }
  return { matches }
}

What I'm trying is to filter calls to a function where one of the parameter's length is greater than 20: uint64[] memory ids
is it possible with custom filters?
thanks! :raised_hands:t2:

Hi @MarcoTabasco ! This is a known issue that we are going to fix soon, your action seem to be throwing some error and Defender UI failing to handle it.
I would try to debug your action by commenting and logging some of the potential issues, for example the payload object.
About your question, it seems to be possible, please see third example in our docs .

Thanks

Thanks! How can I debug the action? where I can find the logs?

About the question, I want to check the array length is not greater than 20, but seems with regular conditionals this is not possible. thanks again

I just tried with conditionals and doesn't seem to be possible as you said

As a workaround (and if that is possible) I would try adding a conditional in the contract code that triggers an event if the array size is greater than 20, then link the monitor with that custom event.

About debugging, if you are in a controlled environment, (which I think is the case because this is in testnet) you can change the action code commenting all the logic and just logging the payload, then triggering the Action by sending a transaction to your contract that matches the condition, and finally checking the Action Run logs, does that make sense?

Makes sense! The action run logs must appear under the main Logs section, correct? let me try, many thanks!
Is there any place to check fix updates like the one you mentioned with the Defender UI (Runs history)

You can see every action run log under Run History, then selecting from the list.

If you just log the payload the Run will be successful for sure. And you will be able to see the log.

1 Like

Hi @MarcoTabasco I also wanted to point out that we will be deprecating Goerli testnet soon and you should migrate to Sepolia at your earliest convenience

Ok thanks!
Related to monitors, I set a transaction filter for one. When triggering the monitor, if the tx filter fails, I can see the logs in Action logs going from an email link, but that action is not available in the actions list like others I create manually. Is this an expected behavior? the action created from the tx filter is named using the monitor name as a suffix.
thanks!

We have begun posting a public changelog here

Related to monitors, I set a transaction filter for one. When triggering the monitor, if the tx filter fails, I can see the logs in Action logs going from an email link, but that action is not available in the actions list like others I create manually. Is this an expected behavior? the action created from the tx filter is named using the monitor name as a suffix.

Apologies I'm having trouble fully understanding the issue. Would you mind recording a quick video?