Somehow, the state.json file is ending up empty, (subsequently causing #473). Likely, a write is being interrupted by a read or another write or the process terminates in the middle of a write, causing the file to be emptied. Need to look into best practices for file reading/writing, including whether using createReadStream/createWriteStream is sufficient or if we need to implement a locking mechanism or a retry mechanism.
Somehow, the state.json file is ending up empty, (subsequently causing #473). Likely, a write is being interrupted by a read or another write or the process terminates in the middle of a write, causing the file to be emptied. Need to look into best practices for file reading/writing, including whether using createReadStream/createWriteStream is sufficient or if we need to implement a locking mechanism or a retry mechanism.