Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(simultaneous-moves): add option to long form move to ignore stale stateID (close #828) #832

Conversation

evandroabukamel
Copy link
Contributor

@evandroabukamel evandroabukamel commented Oct 20, 2020

Solves issue #828 .

Adding ignoreStateStateID option to LongFormMove.
Exporting IsLongFormMove function from game.ts.
On master.ts, getting the move and checking if it does not have the ignoreStateStateID option thuthy before triggering invalid stateID error.

Checklist

  • Use a separate branch in your local repo (not master).
  • Test coverage is 100% (or you have a story for why it's ok).

nicolodavis and others added 13 commits June 20, 2020 17:46
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Sync master from original repository
Merge from base repository
…state.

Add ignoreStateState option to LongFormMove.
Export IsLongFormMove function from game.ts.
On master.ts, get the move and check if it does not have the ignoreStateState option thuthy before triggering invalid stateID error.
…om:evandroabukamel/boardgame.io into evandroabukamel/process-move-stale-stateid
@evandroabukamel evandroabukamel changed the title feat(simultaneous-moves): add option to long form move to ignore stale stateID feat(simultaneous-moves): add option to long form move to ignore stale stateID (close #828) Oct 20, 2020
@evandroabukamel
Copy link
Contributor Author

evandroabukamel commented Oct 20, 2020

The file src/server/index.ts has a lower coverage and is causing coveralls to fail. I didn't work on it.

@delucis
Copy link
Member

delucis commented Oct 20, 2020

The file src/server/index.ts has a lower coverage and is causing coveralls to fail. I didn't work on it.

That’s OK — you don’t need to try to fix the src/server/index.test.ts coverage as part of this PR :-)

src/master/master.ts Show resolved Hide resolved
src/master/master.test.ts Outdated Show resolved Hide resolved
Improved unit test for simultaneous moves.
@evandroabukamel evandroabukamel force-pushed the evandroabukamel/process-move-stale-stateid branch from 07441a2 to 3572f61 Compare October 20, 2020 17:49
@evandroabukamel
Copy link
Contributor Author

I've refactored the code for getMove on master.ts and improved the unit test for simultaneous moves.

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @evandroabukamel — how’s this going? It looks pretty good to me, we probably just need to include a test using an asynchronous storage (like the AsyncInMemory) somehow to make sure the queue protects the master from race conditions as expected.

src/server/transport/socketio.ts Outdated Show resolved Hide resolved
src/server/transport/socketio.ts Outdated Show resolved Hide resolved
src/server/transport/socketio.ts Outdated Show resolved Hide resolved
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @evandroabukamel, I have a couple of questions regarding the implementation, before I look into some more of the details. Thanks!

src/server/transport/socketio.ts Outdated Show resolved Hide resolved
src/server/transport/socketio-simultaneous.test.ts Outdated Show resolved Hide resolved
Reducing PQueue interval to 50ms. It needs to be tested in real world,
@evandroabukamel
Copy link
Contributor Author

I'm trying to install this branch on my project and deploy it on Heroku, but I got "run-s not found". Do someone know how can I solve this? As you can see from my last commits I tried a lot o things but nothing solved it. @delucis or @nicolodavis ? Thanks.

I managed to upload a user-scoped package to NPM and it seem to work fine.

@evandroabukamel evandroabukamel force-pushed the evandroabukamel/process-move-stale-stateid branch from 3097c5d to 48df54e Compare October 28, 2020 20:58
@delucis
Copy link
Member

delucis commented Oct 28, 2020

I'm trying to install this branch on my project and deploy it on Heroku, but I got "run-s not found".

I think the changes in #749 might help, but don’t remember the status there. The run-s command is provided by the npm-run-all package.

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @evandroabukamel — sorry for the wait on going through these and thanks for your patience. Glad to hear the tests with your app went smoothly. Hopefully most of these changes are small details and we can get this merged soon 👍

src/server/transport/socketio-simultaneous.test.ts Outdated Show resolved Hide resolved
packages/server.ts Outdated Show resolved Hide resolved
src/master/master.ts Outdated Show resolved Hide resolved
src/master/master.test.ts Show resolved Hide resolved
src/server/transport/socketio.test.ts Outdated Show resolved Hide resolved
src/server/transport/socketio.ts Outdated Show resolved Hide resolved
@delucis delucis merged commit 6c4e94f into boardgameio:master Nov 7, 2020
@delucis
Copy link
Member

delucis commented Nov 7, 2020

Merged! Thanks for your persistence @evandroabukamel 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants