luceroweb / trivia-and-chill

Using information from The Movie Database API, create a collaborative game where trivia about a movie (movie name, performers, genre, year produced, etc) is provided as a hint, and the user must guess the correct answer based on a list of possible answers. The user has ‘X’ seconds to answer. Click an answer to confirm your guess. If your guess is correct, then you will be rewarded with a link to play the movie trailer. Additional correct guesses will display a badge with the number of correct guesses. An incorrect guess will clear the badge and reset the game. The game can be played with one or more players at a time in person or using a screen share service like Zoom.
https://luceroweb.github.io/guess-the-movie
1 stars 9 forks source link

Question Construction: randomCast undefined bug #200

Closed alberme closed 2 years ago

alberme commented 2 years ago

Date Seen 4/25/22 11:00am

Versions Android emulator iOS Chrome develop

Bug Description Certain movies may have a missing cast, resulting in TypeError: undefined is not an object (evaluating 'randomCast1.name')

Steps to Reproduce

  1. Play game
  2. Answer questions in any manner until randomCast error is thrown
  3. Observe error

This bug is a little hard to reproduce since it's by chance. So far I've observed movie id's 886896 and 831827 have no cast data https://www.themoviedb.org/movie/831827-far-from-the-tree https://www.themoviedb.org/movie/886896-save-the-tree

Expected Behavior The game should play with no game breaking errors

Actual Behavior Certain movies will break the game with an error

Troubleshooting/Testing Steps Attempted In madLibsArray.js I only commented out the hard coded questions and left the dynamic questions in. I also added a randomCast check that logs randomCast undefined! as well as the stack trace and the movie in question.

The stack trace also hints that this error occurs before the recursive check solution implemented by #188 Screenshot from 2022-04-25 16-56-18 image

Workaround If we need to prune this bug ticket, reducing the number of movie querys in FetchApi.js line 4 back to 1 or 2 might be the "band-aid" fix