You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In particular, if a modification occurs to the file contents between them being fetched and them being updated (between lines 6/7 and lines 32/35), those modifications will be overwritten. (There is no "lock" on the "database".)
Fortunately this is not the end of the world as if someone signs the form, but then it gets overridden, this problem will be easily seen in Git history, and can be corrected by humans. And unlike many production databases, we don't expect this to have high QPS, so it's unlikely to happen anyway.
Still, this code is bad and I feel bad for writing it.
The correct fix here is to use Git's conflict resolution mechanism. That is, instead of using the update-file-contents part of the GitHub API, use the submit-and-merge-a-pull-request part of the GitHub API. This would still be done with no human intervention, but it would go through the merge process, thus guaranteeing either a merge conflict or a successful merge.
This has the added benefit that you can watch the participant-data repository to see new entities and individuals get added.
The text was updated successfully, but these errors were encountered:
This code, and its counterpart below for entities, is bad:
participate.whatwg.org/lib/add-data.js
Lines 6 to 36 in 82986e0
In particular, if a modification occurs to the file contents between them being fetched and them being updated (between lines 6/7 and lines 32/35), those modifications will be overwritten. (There is no "lock" on the "database".)
Fortunately this is not the end of the world as if someone signs the form, but then it gets overridden, this problem will be easily seen in Git history, and can be corrected by humans. And unlike many production databases, we don't expect this to have high QPS, so it's unlikely to happen anyway.
Still, this code is bad and I feel bad for writing it.
The correct fix here is to use Git's conflict resolution mechanism. That is, instead of using the update-file-contents part of the GitHub API, use the submit-and-merge-a-pull-request part of the GitHub API. This would still be done with no human intervention, but it would go through the merge process, thus guaranteeing either a merge conflict or a successful merge.
This has the added benefit that you can watch the participant-data repository to see new entities and individuals get added.
The text was updated successfully, but these errors were encountered: