nextcloud / flow

Nextcloud Flow Engine
https://apps.nextcloud.com/apps/flow
GNU Affero General Public License v3.0
11 stars 1 forks source link

convert webhooks.event_filter `None`, `{}` to `[]` #3

Closed bigcat88 closed 3 months ago

bigcat88 commented 3 months ago

without this webhooks got constantly updated:

webhooks_syncing(expected_listeners):
 [
    {
        "webhook": "/api/w/nextcloud/jobs/run/f/u/wapp_jos/file_creation",
        "filters": {},
        "events": [
            "OCP\\Files\\Events\\Node\\NodeWrittenEvent"
        ]
    }
]
get_registered_listeners:  [
    {
        "id": 1,
        "appId": "windmill_app",
        "userId": null,
        "httpMethod": "POST",
        "uri": "/api/w/nextcloud/jobs/run/f/u/wapp_jos/file_creation",
        "event": "OCP\\Files\\Events\\Node\\NodeWrittenEvent",
        "eventFilter": null,
        "userIdFilter": "",
        "headers": null,
        "authMethod": "header",
        "authData": "EDITED"
    }
]
webhooks_syncing: before update_listener: {"id": 1, "appId": "windmill_app", "userId": null, "httpMethod": "POST", "uri": "/api/w/nextcloud/jobs/run/f/u/wapp_jos/file_creation", "event": "OCP\\Files\\Events\\Node\\NodeWrittenEvent", "eventFilter": null, "userIdFilter": "", "headers": null, "authMethod": "header", "authData": "EDITED"}
update_listener: /api/w/nextcloud/jobs/run/f/u/wapp_jos/file_creation - OCP\Files\Events\Node\NodeWrittenEvent
{}
update_listener:
 {
    "id": 1,
    "appId": "windmill_app",
    "userId": null,
    "httpMethod": "POST",
    "uri": "/api/w/nextcloud/jobs/run/f/u/wapp_jos/file_creation",
    "event": "OCP\\Files\\Events\\Node\\NodeWrittenEvent",
    "eventFilter": [],
    "userIdFilter": "",
    "headers": null,
    "authMethod": "header",
    "authData":"EDITED"
}
/api/w/nextcloud/jobs/list

My suggestion is to just convert when value is empty always it to format of []