fix(datastore): count resource errors by latest completed outcome