eternagame / eterna-mobile

Eterna mobile app
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Weird bug regarding design constraints for a lab - doesn't show "violations constraint" on mobile only #86

Closed sbutkovi closed 2 years ago

sbutkovi commented 2 years ago

The "violations constraint" for the current MiniPTC lab doesn't show on mobile, but does show on desktop. All of the other constraints for this lab do show up correctly. I would also like to note that even though the actual constraint doesn't show up on mobile, the outline of that box is red (indicating it isn't satisfied) instead of green (which would indicate it is satisfied), even when I reset the puzzle and it should start out as "green" because no changes have been made (which is the behavior on desktop). Screenshots below:

On mobile:

pic1

pic2

On desktop:

pic3

pic4

This issue does not seem specific to the MiniPTC lab - for example, see this mobile screenshot from one of the OpenVaccine labs:

pic5

luxaritas commented 2 years ago

The constraint script 9606956 was crashing because it fetches the puzzle info from the API by finding the puzzle ID in the URL, but it was grabbing part of the mobile app URL that wasn't the actual puzzle ID. I've resolved the issue for this script by changing:

href.match(/\d{6,}/)[0];

(or something like that, I didn't write down the exact original expression) to

href.match(/(Application\/[^\/]+\/)?[^\d]+(\d{6,})/)[2];

We'll have to keep an eye out if this presents an issue with other scripted constraints.