Repository: gatsbyjs/gatsby
File: packages/gatsby/src/utils/api-runner-node.js (JavaScript)

Code before:
              )} in ${chalk.bold(plugin.name)}.
              Ensure that you return a Promise from ${chalk.bold(
                `createPages`
              )} and are awaiting any asynchronous method invocations (like ${chalk.bold(
                `graphql`
              )} or http requests).
              For more info and debugging tips: see ${chalk.bold(
                `https://gatsby.dev/sync-actions`
              )}
            `),
            ]

            const possiblyCodeFrame = getNonGatsbyCodeFrameFormatted()
            if (possiblyCodeFrame) {
              warning.push(possiblyCodeFrame)
            }

            reporter.warn(warning.join(`\n\n`))
            alreadyDisplayed = true
          }
        },
      }
    }
    const localReporter = getLocalReporter(activity, reporter)

    let runningActivities = new Set()

    const localReporterThatCleansUpAfterMisbehavingPlugins = {
      ...localReporter,
      activityTimer: (...args) => {
        const activity = reporter.activityTimer(...args)

        return {
          ...activity,
          start: () => {
            activity.start()
            runningActivities.add(activity)
          },
          end: () => {
            activity.end()
            runningActivities.delete(activity)
          },
        }
      },
      createProgress: (...args) => {
        const activity = reporter.createProgress(...args)

        return {
          ...activity,
          start: () => {
            activity.start()

Review comment (suggestion):
```suggestion
    const runningActivities = new Set()
```

Code after:
              )} in ${chalk.bold(plugin.name)}.
              Ensure that you return a Promise from ${chalk.bold(
                `createPages`
              )} and are awaiting any asynchronous method invocations (like ${chalk.bold(
                `graphql`
              )} or http requests).
              For more info and debugging tips: see ${chalk.bold(
                `https://gatsby.dev/sync-actions`
              )}
            `),
            ]

            const possiblyCodeFrame = getNonGatsbyCodeFrameFormatted()
            if (possiblyCodeFrame) {
              warning.push(possiblyCodeFrame)
            }

            reporter.warn(warning.join(`\n\n`))
            alreadyDisplayed = true
          }
        },
      }
    }
    const localReporter = getLocalReporter(activity, reporter)

    const runningActivities = new Set()

    const localReporterThatCleansUpAfterMisbehavingPlugins = {
      ...localReporter,
      activityTimer: (...args) => {
        const activity = reporter.activityTimer.apply(reporter, args)

        return {
          ...activity,
          start: () => {
            activity.start()
            runningActivities.add(activity)
          },
          end: () => {
            activity.end()
            runningActivities.delete(activity)
          },
        }
      },
      createProgress: (...args) => {
        const activity = reporter.createProgress.apply(reporter, args)

        return {
          ...activity,
          start: () => {
            activity.start()