This is what you have to do.
Yes, it is possible to have a race condition. However, there is no other option.
@zoul - I have no idea if this will get rid of your race condition, but a better way to add to an existing array is to use the spread operator.
From the docs:
It is commonly used when you want to add a new item to a local data store, or display all stored items plus a new addition. A very simple version of this kind of action could look like so:
let numberStore = [0, 1, 2];
let newNumber = 12;
numberStore = [...numberStore, newNumber];
@zoul - I have no idea if this will get rid of your race condition, but a better way to add to an existing array is to use the spread operator.
From the docs:
It is commonly used when you want to add a new item to a local data store, or display all stored items plus a new addition. A very simple version of this kind of action could look like so:
let numberStore = [0, 1, 2];
let newNumber = 12;
numberStore = [...numberStore, newNumber];
It will not really affect the possibility of a race condition. You are still reading the previous value and adding the new one before writing the whole array back. This will not affect the fact that someone else could have updated the field in between the read and the write. At best, it will slightly decrease the time between the read and the write, but it is impossible to reduce that time to zero.
On the other hand, given how most Airtable bases are used, it is unlikely that this will be a problem in most situations. If this type of split second timing important, Airtable may not be the right platform.