<commit_before>const SyncbackTask = require('./syncback-task')
const TaskHelpers = require('./task-helpers')

class MoveToFolderIMAP extends SyncbackTask {
  description() {
    return `MoveToFolder`;
  }

  run(db, imap) {
    const threadId = this.syncbackRequestObject().props.threadId
    const toFolderId = this.syncbackRequestObject().props.folderId

    const eachMsg = ({message}) => {
      return imap.move(message.messageId, toFolderId)
    }

    return TaskHelpers.forEachMessageInThread({threadId, db, imap, callback: eachMsg})<commit_msg>Use CategoryId instead of messageId<commit_after>const SyncbackTask = require('./syncback-task')
const TaskHelpers = require('./task-helpers')

class MoveToFolderIMAP extends SyncbackTask {
  description() {
    return `MoveToFolder`;
  }

  run(db, imap) {
    const threadId = this.syncbackRequestObject().props.threadId
    const toFolderId = this.syncbackRequestObject().props.folderId

    const eachMsg = ({message}) => {
      return imap.move(message.CategoryId, toFolderId)
    }

    return TaskHelpers.forEachMessageInThread({threadId, db, imap, callback: eachMsg})
{'fraction_non_alphanumeric': 0.11691762621789194, 'fraction_numerical': 0.0, 'mean_word_length': 4.566502463054187, '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': '3399185', 'n_tokens_mistral': 339, 'n_tokens_neox': 338, 'n_words': 69}