Skip to content

Bug: analytics.controller.js uses hardcoded fake member profiles — member metrics bear no relation to actual workspace users #161

@anshul23102

Description

@anshul23102

Description

In backend/controllers/analytics.controller.js, the getAnalytics endpoint fetches real task and message data from Supabase, then discards all actual user attribution and replaces it with statistics generated from a hardcoded list of six fake team members (Alex Rivera, Jordan Smith, Casey Morgan, Riley Lee, Morgan Patel, Quinn Taylor).

Tasks are pseudo-randomly assigned to these fictional members using a hash function, and completion/review counts are computed with arbitrary multipliers and offsets. None of these analytics reflect who actually created, completed, or reviewed tasks.

const memberProfiles = [
    { id: "alex", name: "Alex Rivera", role: "Lead Frontend Engineer", ... },
    ...
];

function buildMembers(tasks = [], messages = []) {
    return memberProfiles.map((profile, index) => {
        const assignedTasks = tasks.filter((task, taskIndex) => {
            const seed = hashString(task.id || task.title || taskIndex);
            return seed % memberProfiles.length === index;  // fake assignment
        });
        ...
    });
}

To Reproduce

  1. Create real user accounts and assign tasks to specific users.
  2. Call GET /api/analytics.
  3. Observe that the returned member analytics show the six hardcoded fake members, not the real users.

Expected Behavior

Member analytics should be derived from real data: who created tasks, who marked them done, who sent messages. If user attribution is not yet stored in the tasks/messages schema, the analytics should accurately state that per-member breakdowns are unavailable rather than fabricating them.

Actual Behavior

Six fictitious team members are returned with plausible-looking but entirely fabricated statistics.

Desktop

  • Backend: Node.js / Express / Supabase
  • File: backend/controllers/analytics.controller.js

Additional context

Expected NSOC points: level3 (significant feature correctness bug affecting core analytics functionality)

Labels: bug, NSoC'26, level3

Checklist:

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions