greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.41k stars 422 forks source link

Webhooks cannot be edited #1269

Closed adamlui closed 4 weeks ago

adamlui commented 1 month ago

There's no way to edit webhooks once created, I had to go to script page, "Turn off syncing" to get webhook to disappear from https://greasyfork.org/en/users/webhook-info, go to GitHub repo > Settings > Webhooks, delete GF webhook, confirm, Add webhook, fill in payload URL, update content-type, fill in secret, Add webhook, and even then it's unclear what is the URL it's going to try to sync with

Originally posted by @adamlui in https://github.com/greasyfork-org/greasyfork/issues/1253#issuecomment-2148191440

adamlui commented 1 month ago

I went to https://greasyfork.org/en/scripts/460805-autoclear-chatgpt-history/admin and filled in raw user.js URL to get webhook to finally show up in https://greasyfork.org/en/users/webhook-info but the issue remains, existing webhooks simply cannot be edited without going thru the aforementioned arduous process

adamlui commented 1 month ago

Previous to all this I clicked "Turn off syncing for this script" because there was no way to edit URLs is how I got to the URL add step again, so the URL should be editable directly on that page instead (similar to "URL of script to promote")

adamlui commented 1 month ago

I don't mind doing hard work I am only looking out for the interests of lazy other users

adamlui commented 1 month ago

Also I tested your last update of allowing unraw URL for update by de-activating BraveGPT sync, then re-adding the URL, then in Webhooks page it shows this:

image

JasonBarnabe commented 1 month ago

When a script is set to update via webhook, it just means that Greasy Fork will never automatically check for updates - it will just wait for webhook notifications.

If you want to change what URL your script is syncing from, you can do so from the admin tab of your script.

adamlui commented 1 month ago

You can't though is what I'm explaining, user has to turn off syncing to be able to add a new URL to sync for it to appear in the Webhook page

adamlui commented 1 month ago

Also I tested your last update of allowing unraw URL for update by de-activating BraveGPT sync, then re-adding the URL, then in Webhooks page it shows this:

image

Actually this bug occurs for if raw URL is added too, the issue is if user did not select "Automatic" or "Manual" (which they don't expect to if merely supplying a URL for webhook to use) then name var is empty

image

adamlui commented 1 month ago

To better explain, this is what user sees in script admin if webhook is working:

image

There is no way to change webhook sync src URL. User has to click 'Turn off syncing for this script' then it reverts to unsynced interface:

image

Then, working webhook is removed from the https://greasyfork.org/en/users/webhook-info page.

Then, to set up a new webhook again, user must input webhook's intended sync src URL in 'To enable syncing for your script, provide a URL'

image

Then they must click 'Update and sync now', then the interface changes to one where URL can be editable:

image

Then, the https://greasyfork.org/en/users/webhook-info page shows the weird unnamed sync-type glitch if they didn't pick auto/manual (since they don't expect to for setting up a webhook and this is the only way):

image

Then, after first webhook sync, script admin changes to remove editable URL field:

image

... while https://greasyfork.org/en/users/webhook-info page no longer shows 'Name' for sync-type if auto/manual wasn't selected, but accurately reflects 'Webhook'

image

adamlui commented 1 month ago

So you just have to add the sync src URL field to the script admin interface where 'Webhook' is selected to fix this issue (also ideally allowing users to select 'Webhook' from script admin directtly is more intuitive than going to an account page for GitHub-side instructions that end up adding 'Webhook' radio on script admin page like user was able to select but aren't so if they remove they forget how to add)

adamlui commented 1 month ago

So to summarize, there are two issues. Currently to add webhook, a sync src URL must exist first, and the only way is to supply it in the script admin page. So the two problems are:

  1. If user is using this field only for this purpose, they expect to pick 'Webhook' directly right then and there. Not seeing such option, they will not pick 'Auto' or 'Manual' and the unnamed sync-type glitch occurs on https://greasyfork.org/en/users/webhook-info (until first successful webhook sync)
  2. After added + first successful webhook sync, sync src URL becomes permanently uneditable as URL field outright disappears from script admin page
JasonBarnabe commented 4 weeks ago

1 - this was an oversight and is fixed now. 2 - didn't see this happen, but I made some changes to this area so maybe it's fixed. If not let me know and provide the URL of the script that's showing weird.

adamlui commented 4 weeks ago

2 - didn't see this happen, but I made some changes to this area so maybe it's fixed. If not let me know and provide the URL of the script that's showing weird.

It's this screenshot I provided:

336614739-b78baeaf-7979-4269-b735-8abf5937f823

There's no URL field for webhook sync src (you can always view as test user acct, it may be ages before I need to update again)

adamlui commented 4 weeks ago

(the field in the shot is for description srcs)

JasonBarnabe commented 4 weeks ago

This is always editable now, no matter how it's set up to sync.

Please take the time to understand what I'm telling you, then post one single reply if you have further comments, questions, or suggestions.

adamlui commented 4 weeks ago

You said "didn't see this happen" so I showed you how it wasn't editable. I 100% understood you "made some changes to this area so maybe it's fixed", I merely show you the problem in case it wasn't (because you claimed to not see it so I showed it again)

JasonBarnabe commented 4 weeks ago

I was referring the issue where it says "Name syncing from" - I was not able to reproduce that.

adamlui commented 4 weeks ago

Oh you got your numbers reversed then (my 1 was name syncing, 2 was URL field missing, your 1 was it is fixed, 2 was didn't see)