Updates the solutionAvailable field placed in CrosswordData to be the result of comparing dateSolutionAvailable against the current timestamp
The problem:
The crossword players offer options to help users who are struggling - they can check whether their answer is correct, or reveal the answer if they don't have an idea. But some crosswords offer a prize for correct solutions, so these helpers aren't available for a period of time (usually a week) to allow for clean(er) competition.
The CAPI data includes the solutions, regardless of whether that period of time has passed or not. It has therefore been the responsibility of frontend to compare the dateSolutionAvailable field with the current time, and strip the solutions if required -- which it has done for a long time without problem.
However, there is another field on the data called solutionAvailable which appears to be a useful flag that can be used to decide whether to show the check and reveal options - but this can be misleading since it is also not updated in CAPI - so the field will show whether the solutions should have been available when the crossword was originally sent to CAPI -- ie. for quick and cryptic crosswords it will always be true, but for prize crosswords it will always be false (except in the case of a very late filing!).
You can see one consequence of this problem already: Prize crosswords' accessible pages all/mostly say "Sorry, solutions are not available for this puzzle yet", despite the day quoted for release of the solutions being in the past!
eg: (current date is 15th Nov)
The solution:
It would probably be best for consumers to check that the entries do contain solution data, or compare against the dateSolutionAvailable field. That said, since this field exists and removing would be complicated, it's probably best to make frontend also update the field when it is building its crossword data, after comparing dateSolutionAvailable to the current time, so this commit does exactly that.
All deployment options
- [Deploy build 3275 of `dotcom:frontend-all` to CODE](https://riffraff.gutools.co.uk/deployment/deployAgain?project=dotcom%3Afrontend-all&build=3275&stage=CODE&updateStrategy=MostlyHarmless&action=deploy)
- [Deploy parts of build 3275 to CODE by previewing it first](https://riffraff.gutools.co.uk/preview/yaml?project=dotcom%3Afrontend-all&build=3275&stage=CODE&updateStrategy=MostlyHarmless)
- [What's on CODE right now?](https://riffraff.gutools.co.uk/deployment/history?projectName=dotcom%3Afrontend-all&stage=CODE)
Keep an eye on the deploy dashboard&_a=(description:'',filters:!(),fullScreenMode:!f,options:(darkTheme:!f,useMargins:!f),panels:!((gridData:(h:4,i:'4',w:6,x:6,y:0),id:'735f9ce0-4a04-11e7-9f15-395e2d1c9b1f',panelIndex:'4',type:visualization,version:'6.2.4'),(gridData:(h:4,i:'5',w:6,x:0,y:0),id:b9249830-4a03-11e7-91e8-2fbfd59c38bb,panelIndex:'5',type:visualization,version:'6.2.4'),(gridData:(h:4,i:'7',w:6,x:0,y:4),id:ac507b90-4a0f-11e7-9f15-395e2d1c9b1f,panelIndex:'7',type:visualization,version:'6.2.4'),(gridData:(h:4,i:'9',w:6,x:6,y:4),id:a5f78860-4ad2-11e7-9930-73b4968e85d8,panelIndex:'9',type:visualization,version:'6.2.4')),query:(language:lucene,query:(query_string:(analyze_wildcard:!t,query:'stage:PROD%20NOT%20app:preview'))),timeRestore:!f,title:'Frontend%20PROD%20Deploy',viewMode:view)) 📉
Keep an eye on the deploy dashboard&_a=(description:'',filters:!(),fullScreenMode:!f,options:(darkTheme:!f,useMargins:!f),panels:!((gridData:(h:4,i:'4',w:6,x:6,y:0),id:'735f9ce0-4a04-11e7-9f15-395e2d1c9b1f',panelIndex:'4',type:visualization,version:'6.2.4'),(gridData:(h:4,i:'5',w:6,x:0,y:0),id:b9249830-4a03-11e7-91e8-2fbfd59c38bb,panelIndex:'5',type:visualization,version:'6.2.4'),(gridData:(h:4,i:'7',w:6,x:0,y:4),id:ac507b90-4a0f-11e7-9f15-395e2d1c9b1f,panelIndex:'7',type:visualization,version:'6.2.4'),(gridData:(h:4,i:'9',w:6,x:6,y:4),id:a5f78860-4ad2-11e7-9930-73b4968e85d8,panelIndex:'9',type:visualization,version:'6.2.4')),query:(language:lucene,query:(query_string:(analyze_wildcard:!t,query:'stage:PROD%20NOT%20app:preview'))),timeRestore:!f,title:'Frontend%20PROD%20Deploy',viewMode:view)) 📉
Updates the
solutionAvailable
field placed inCrosswordData
to be the result of comparingdateSolutionAvailable
against the current timestampThe problem:
The crossword players offer options to help users who are struggling - they can check whether their answer is correct, or reveal the answer if they don't have an idea. But some crosswords offer a prize for correct solutions, so these helpers aren't available for a period of time (usually a week) to allow for clean(er) competition.
The CAPI data includes the solutions, regardless of whether that period of time has passed or not. It has therefore been the responsibility of frontend to compare the
dateSolutionAvailable
field with the current time, and strip the solutions if required -- which it has done for a long time without problem.However, there is another field on the data called
solutionAvailable
which appears to be a useful flag that can be used to decide whether to show the check and reveal options - but this can be misleading since it is also not updated in CAPI - so the field will show whether the solutions should have been available when the crossword was originally sent to CAPI -- ie. for quick and cryptic crosswords it will always be true, but for prize crosswords it will always be false (except in the case of a very late filing!).You can see one consequence of this problem already: Prize crosswords' accessible pages all/mostly say "Sorry, solutions are not available for this puzzle yet", despite the day quoted for release of the solutions being in the past!
eg: (current date is 15th Nov)
The solution:
It would probably be best for consumers to check that the entries do contain solution data, or compare against the
dateSolutionAvailable
field. That said, since this field exists and removing would be complicated, it's probably best to make frontend also update the field when it is building its crossword data, after comparingdateSolutionAvailable
to the current time, so this commit does exactly that.