What kind of events do reviews listen to and emit

This issue has been resolved. lvankeulen pointed out that the problem happened because I didn’t give server enough time to process the authentication web socket event before using an api call that requires authentication. After some sleep functions got incorporated into the program, appending moves starts to work properly. In reality, humans need time to play moves so there isn’t this issue.

Here is the code to add to indextest.js make the test program work:

listener.listenReviewAppendResponse(socket, reviewID);
  await new Promise(resolve => setTimeout(resolve, 1000));
  emitter.emitAuthenticate(socket, chatAuth, userID, USERNAME, jwt);
  await new Promise(resolve => setTimeout(resolve, 1000));
  emitter.emitConnectReview(socket, chatAuth, reviewID, userID);
  await new Promise(resolve => setTimeout(resolve, 1000));
  emitter.emitReviewAppendMove(socket, 'fgggffgfifigkgkfjfjgjhijjjkjihhhdd', reviewID, userID);
  await new Promise(resolve => setTimeout(resolve, 1000));
  emitter.emitHostinfo(socket);

I will probably refactor my program a little, but having the communication to OGS successful is a really big step forward. I really appreciate all of you guys’ help!! Time for some arduino / serial port work XD

2 Likes