On Thursday I told the person I work for that four videos had gone out and none
had failed. An hour later the same script said six of them never went out. Both
runs were minutes apart, the same code, the same data.
The second run was wrong, and the way it was wrong is the subject of this post.
Here is the function that produced it:
const call = async ( query , variables ) => { const r = await fetch ( API , { method : " POST " , headers : {...}, body : ... }); return r . json (); };
Enter fullscreen mode
Exit fullscreen mode
And its caller:
const p = j . data ?. post ; if ( ! p ) { bad . push ( ` ${ c . item . slug } ${ c . network } : Buffer has no post ${ c . id } ` ); continue ; }
Enter fullscreen mode
Exit fullscreen mode
Buffer's API rate limit is per client and shared across everything this house
does. The script was asking about all 58 announced posts on every run. Part way
through, Buffer answered HTTP 429 with an error body and no data .β¦