<commit_before>import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { StudentProfiles } from '../../../api/user/StudentProfileCollection';
import { userInteractionDefineMethod } from '../../../api/log/UserInteractionCollection.methods';

let cursorHandle;

Template.Observe_Interactions.helpers({
  startObserve() {
    console.log('startObserve started!');
    if (Meteor.userId()) {
      const studentDocumentsCursor = StudentProfiles.find({ userID: `${Meteor.userId()}` });
      cursorHandle = studentDocumentsCursor.observeChanges({
        // This assumes that only one field is modified at a time by the student.
        changed: function (id, field) {
          const userID = Meteor.userId();
          const type = Object.keys(field).toString();
          let typeData = Object.values(field).toString();
          if (typeData === '') typeData = 'n/a';
          console.log(userID, type, typeData);
          setTimeout(function () {
            userInteractionDefineMethod.call({ userID, type, typeData }, (error) => {
              if (error) {
                console.log('Error creating UserInteraction.', error);
              }
            });
          }, 0);
        },
      });
    }
  },
});

Template.Observe_Interactions.onDestroyed(function () {
  cursorHandle.stop();
  console.log('stopped observeChanges');
});
<commit_msg>Removed a console.log()<commit_after>import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { StudentProfiles } from '../../../api/user/StudentProfileCollection';
import { userInteractionDefineMethod } from '../../../api/log/UserInteractionCollection.methods';

let cursorHandle;

Template.Observe_Interactions.helpers({
  startObserve() {
    console.log('startObserve started!');
    if (Meteor.userId()) {
      const studentDocumentsCursor = StudentProfiles.find({ userID: `${Meteor.userId()}` });
      cursorHandle = studentDocumentsCursor.observeChanges({
        // This assumes that only one field is modified at a time by the student.
        changed: function (id, field) {
          const userID = Meteor.userId();
          const type = Object.keys(field).toString();
          let typeData = Object.values(field).toString();
          if (typeData === '') typeData = 'n/a';
          setTimeout(function () {
            userInteractionDefineMethod.call({ userID, type, typeData }, (error) => {
              if (error) {
                console.log('Error creating UserInteraction.', error);
              }
            });
          }, 0);
        },
      });
    }
  },
});

Template.Observe_Interactions.onDestroyed(function () {
  cursorHandle.stop();
  console.log('stopped observeChanges');
});

{'fraction_non_alphanumeric': 0.1452493629413906, 'fraction_numerical': 0.0007280669821623589, 'mean_word_length': 2.7438692098092643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5392484', 'n_tokens_mistral': 761, 'n_tokens_neox': 752, 'n_words': 163}