GhostWording / gw-config-apis

this repo contains static json that can live through apis with github management only
0 stars 7 forks source link

Error in the Masterfile parsing logic #23

Closed andreasdieryck closed 6 years ago

andreasdieryck commented 6 years ago

From Slack 12/02/2017:

We have spotted an interesting behaviour (bug?) in the masterfile parsing logic:

If we take the example of an array X, we would expect that:

a. When we reach the first of occurrence of X in the masterfile, one file X1 in the array is chosen randomly and we display it to the user
b. When we reach the second occurrence of X in the masterfile (similar or different ordering number), one file X2 in the array is chosen randomly and we display it to the user. This file X2 however has to be different from X1 - X1 should be considered as already "read" by the user.
c. Same when we reach the next occurrence of X: we expect new files (not X1 or X2)  until we don't have any anymore

Instead, it seems that we have the following behaviour:

a. When we reach the first of occurrence of X in the masterfile, one file X1 in the array is chosen randomly and we display it to the user
b. When we reach the second occurrence of X in the masterfile (similar or different ordering number), we don't receive any file at all. Same for the third and fourth occurence (if relevant)

My hypothesis is that we consider these arrays to be similar objects altogether and therefore we skip them when seen a second time. However, that doesn't sound like it obeys the predefined behaviour.

Happy to help :)