• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NodeBB / NodeBB / 23305017021

19 Mar 2026 04:20PM UTC coverage: 85.425% (-0.1%) from 85.545%
23305017021

push

github

nodebb-misty
chore: update changelog for v4.10.0

13445 of 18442 branches covered (72.9%)

28384 of 33227 relevant lines covered (85.42%)

3333.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/plugins/usage.js
1
'use strict';
2

3
const nconf = require('nconf');
32✔
4
const winston = require('winston');
32✔
5
const crypto = require('crypto');
32✔
6

7
const request = require('../request');
32✔
8
const cron = require('../cron');
32✔
9
const pkg = require('../../package.json');
32✔
10

11
const meta = require('../meta');
32✔
12

13
module.exports = function (Plugins) {
32✔
14
        Plugins.startJobs = async function () {
32✔
15
                await cron.addJob({
×
16
                        name: 'plugins:submitUsageData',
17
                        cronTime: '0 0 0 * * *',
18
                        onTick: Plugins.submitUsageData,
19
                });
20
        };
21

22
        Plugins.submitUsageData = async function () {
32✔
23
                if (!meta.config.submitPluginUsage || !Plugins.loadedPlugins.length || process.env.NODE_ENV !== 'production') {
4✔
24
                        return;
1✔
25
                }
26

27
                const hash = crypto.createHash('sha256');
3✔
28
                hash.update(nconf.get('url'));
3✔
29
                const url = `${nconf.get('registry') || 'https://packages.nodebb.org'}/api/v1/plugin/usage`;
3✔
30
                try {
3✔
31
                        const { response, body } = await request.post(url, {
3✔
32
                                body: {
33
                                        id: hash.digest('hex'),
34
                                        version: pkg.version,
35
                                        plugins: Plugins.loadedPlugins,
36
                                },
37
                                timeout: 5000,
38
                        });
39

40
                        if (!response.ok) {
3!
41
                                winston.error(`[plugins.submitUsageData] received ${response.status} ${body}`);
×
42
                        }
43
                } catch (err) {
44
                        winston.error(err.stack);
×
45
                }
46
        };
47
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc