openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

Connected App is connecting twice #12471

Closed mkllnk closed 5 months ago

mkllnk commented 5 months ago

:information_source: Please use project Discover Regenerative (Macdoch pt 2): 3. Open Source Tech Evolution to track work on this issue.

Description

Some people manage to click the button to connect the Discover Regenerative app twice. It then creates two Connected App records and triggers two webhooks which can create two entries in the portal database.

I think that this happens when the server is busy or the connection is slow. The button is turned into a disabled "Loading" button with a delay and that delay can be longer when the server is busy, allowing for multiple clicks.

We should disable the button after clicking straight away.

Expected Behavior

You can click the button only once.

Actual Behaviour

You can click the button multiple times. The slower the server responds, the more often you can click it.

Steps to Reproduce

  1. Turn on feature for connected apps.
  2. Go to enterprise settings and connected apps.
  3. Click on the connect button many times as fast as possible.
  4. Check the webhook executions in n8n.

Animated Gif/Screenshot

Workaround

Severity

Your Environment

Possible Fix

kirstenalarsen commented 5 months ago

@mkllnk please connect clockify code to this issue

mkllnk commented 5 months ago

Okay, tracking under Discover Regenerative (Macdoch pt 2): 3. Open Source Tech Evolution.