Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • predi predi
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kjetil Thuen
  • predipredi
  • Issues
  • #75

Closed
Open
Created Feb 18, 2015 by Kjetil Thuen@kjetilMaintainer

In some cases, the user is allowed to buy 0 shares, which will corrupt the database with division by zero values

The server should refuse to handle 0 trades. This is the activity log in question:

{ _id: "Qaid9mMy9Xc29GYES", 
  timestamp: 1424264439357, 
  user_id: "2Hq9T4GPn7cycGCTv", 
  type: "trade", 
  value: { market_id: "CTMddDY5JMgkti9QB",  
           set_id: "JwaffaL8HjbmFcayd", 
           contract_id: "KuBzptNwS7aTr432X", 
           trade_amount: NaN, 
           owned_before: 0, 
           owned_after: NaN, 
           outstanding_before: 0, 
           outstanding_after: NaN, 
           cash_before: 15.29357415712525,
           cash_after: 15.29357415712525,
           set_id: "JwaffaL8HjbmFcayd",
           thawed: 0,
           trade_amount: Nan,
           prices: { QjbMdnCgAzxHvZmSY: NaN, 
                     KuBzptNwS7aTr432X: NaN, 
                     htMpSWmhWLLhumanR: NaN }
         } 
  }
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking