Git Product home page Git Product logo

dice-with-microservices's People

Contributors

alessandrodgr avatar cardiamc avatar deremo avatar giobart avatar laurab1 avatar michelefontana92 avatar orneladanushi avatar shinkage avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

giobart

dice-with-microservices's Issues

Bug with rolled dices and roll persistance

While working on the feature of draft stories, I've found that we do not store the rolls of a story, therefore is impossible to edit and check a drafted story.
At this moment (see #20), whenever we roll dices in the rollDice endpoint we save the result in a global variable that is read by the writeStory endpoint. This means that if another roll happens during the process of writing the story, the roll will be overwritten and the checks would fail unexpectedly, and this is not tested. So we need to find another way of dealing with the roll. Some proposal are

  1. Send the roll to the client GET and request it back with the POST, this means that the user has control over the dice rolls, but requires minor changes.
  2. Save an index of rolls in memory, the fastest solution but memory intensive.
  3. Since I'm implementing the editing functionality for drafts, when we roll we create an empty draft with the rolls already in the database and we redirect the user to the edit functionality where he can left the story as a draft or complete the submission.

In my opinion the solution 3 is the best one. No other data structures are needed, no risk of race conditions and the only drawback is that we can have some, minor, number of empty drafts in the database until completion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.