openfoodfoundation / openfoodnetwork

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

Data sharing button - avoid creating multiple listings if button clicked twice #12212

Open kirstenalarsen opened 4 months ago

kirstenalarsen commented 4 months ago

Currently it is possible to create multiple mini-extensions form links/Airtable records if the Allow Data Sharing button is clicked twice while waiting for the button change to 'Stop Sharing' to load on the screen.

Can this be avoided?

When a user stops and re-starts data sharing, this also creates a new miniextension form and record in Airtable

mkllnk commented 1 month ago

The first part has been solved:

Stopping and re-starting the data sharing needs more thought. We currently don't delete all data and re-connecting should connect to the existing data of assurances. The workflow may not work 100% as expected though. And if you do the disconnect and reconnect quickly, there may be a race condition.