Continued iterating on calculations, added failing test for bugs found

This commit is contained in:
Stefan Zermatten
2021-09-27 17:26:52 +02:00
parent 85e8756d1d
commit b0ee5cd304
9 changed files with 67 additions and 16 deletions

View File

@@ -15,7 +15,7 @@ let schema = new SimpleSchema({
Meteor.publish('singleCharacter', function(creatureId){
schema.validate({ creatureId });
this.autorun(function (){
this.autorun(function (computation){
let userId = this.userId;
let creatureCursor
creatureCursor = Creatures.find({
@@ -24,7 +24,7 @@ Meteor.publish('singleCharacter', function(creatureId){
let creature = creatureCursor.fetch()[0];
try { assertViewPermission(creature, userId) }
catch(e){ return [] }
if (creature.computeVersion !== VERSION){
if (creature.computeVersion !== VERSION && computation.firstRun){
try {
computeCreature(creatureId)
}