GregoryCannon / GregoryCannon/StackRabbit

Bug in formatEngineResultStyleA with bad stack

Open
#12 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
462
Forks
50
PR merge metrics
No merged PRs in 30d

Description

The server fails when given a difficult board. I was able to get a stack trace from my own server.

TypeError: Cannot read properties of null (reading 'evalScore')
    at /home/stack/StackRabbit-git/built/src/server/engine_lookup.js:105:52
    at Array.map (<anonymous>)
    at /home/stack/StackRabbit-git/built/src/server/engine_lookup.js:100:41
    at Array.map (<anonymous>)
    at formatEngineResultStyleA (/home/stack/StackRabbit-git/built/src/server/engine_lookup.js:86:25)
    at Object.engineLookup (/home/stack/StackRabbit-git/built/src/server/engine_lookup.js:46:12)
    at RequestHandler.handleEngineLookup (/home/stack/StackRabbit-git/built/src/server/request_handler.js:402:47)
    at RequestHandler.routeRequest (/home/stack/StackRabbit-git/built/src/server/request_handler.js:136:30)
    at /home/stack/StackRabbit-git/built/src/server/app.js:48:40
    at Layer.handle [as handle_request] (/home/stack/StackRabbit-git/node_modules/express/lib/router/layer.js:95:5)

Request:
https://stackrabbit.herokuapp.com/engine?board=0000000X000000000X0000XXX0XX0X00XXX00X0X0X0XXXXX0X0XXXXXXXXX0XXXXXX0XX00XXXXX0XX00000XXXXX00000XXXXX000000XXXX00XXXXX000X0XXX00000X0XXX00000X0XX000000XXX000XXX0XX000XXXX0XXX0XXXXX0XXXXXXXXX0XXXXXXXXX0&currentPiece=S&nextPiece=O&level=18&lines=126&reactionTime=0&inputFrameTimeline=X..

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with built/src/server/engine_lookup.js around formatEngineResultStyleA and the failing line near 105, then trace the request through built/src/server/request_handler.js. Re-run the supplied /engine request and verify that this difficult board no longer causes a null evalScore failure and returns a response.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.