Skip to content

fix: task board live updates, auth headers, security hardening, and cleanup - #265

Merged
ChitkulLakshya merged 13 commits into
mainfrom
fix/task-board-live-updates-and-security-hardening
Aug 13, 2026
Merged

fix: task board live updates, auth headers, security hardening, and cleanup#265
ChitkulLakshya merged 13 commits into
mainfrom
fix/task-board-live-updates-and-security-hardening

Conversation

@ChitkulLakshya

Copy link
Copy Markdown
Member

Summary

This PR fixes the task board live-update mechanism, adds missing authentication headers, hardens security, fixes pre-existing bugs, and cleans up duplicate files.

Task board live updates (no refresh needed)

  • Forward getTaskIO through webhook queue so GitHub push/PR transitions emit task-updated socket events to connected clients
  • Add task-created + task-assigned socket emissions to both Kanban task creation routes (POST /steps/:stepId/tasks and POST /quick-task)
  • Previously only task update/delete and the separate /api/tasks/assign route emitted socket events; task creation required a manual refresh

Auth and response handling

  • Add missing Authorization: Bearer header to task create/update in ProjectDetails.tsx and task create in MobileProjectDetails.tsx
  • Add response.ok check to task update handler with refetch + error toast on failure

Security hardening

  • Protect /api/internal-metrics/metrics with authMiddleware (was publicly accessible)
  • Update puppeteer 24.x → 25.6.0 to fix high-severity extract-zip symlink path traversal vulnerability

Bug fixes

  • Fix ProjectTask sparse unique index collision: remove default: null from displayId and commitCode so sparse indexes skip unset fields instead of colliding on null
  • Remove redundant schema.index() calls in User.js and Team.js that caused duplicate index warnings
  • Fix missing API_BASE_URL import in ArchitectureView.tsx (typecheck error)
  • Add missing braces after if statements in DesktopView.tsx and MobileView.tsx (lint errors)
  • Fix flaky auth E2E test
  • Set Jest maxWorkers: 1 to avoid jose ESM race condition under parallel workers

Cleanup

  • Delete 18 duplicate " 2" files that were tracked in git (source code, docs, temp files)

Files changed

  • backend/services/webhookQueue.js — forward getTaskIO to worker
  • backend/services/githubWebhookWorker.js — emit task-updated on push/PR transitions
  • backend/routes/githubAppWebhook.js — supply getTaskIO getter
  • backend/routes/projectRoutes.js — emit task-created/task-assigned on task creation
  • backend/routes/internalMetrics.js — add authMiddleware
  • backend/models/ProjectTask.js — fix sparse index
  • backend/models/User.js, backend/models/Team.js — remove duplicate indexes
  • backend/jest.config.js — maxWorkers: 1
  • backend/package.json — puppeteer 25.6.0
  • src/pages/ProjectDetails.tsx — auth headers + response.ok
  • src/components/views/mobile/MobileProjectDetails.tsx — auth header
  • src/components/zlam/ArchitectureView.tsx — API_BASE_URL import
  • src/components/views/DesktopView.tsx, MobileView.tsx — lint fixes
  • tests/auth.spec.ts — flaky test fix
  • backend/tests/projectRoutesTasks.test.js — 4 new regression tests (B25-B28)
  • backend/tests/githubWebhookWorker.test.js — 2 new regression tests (W8-W9)
  • Various test files — authMiddleware mocks
  • 18 duplicate " 2" files deleted

Test plan

  • Backend Jest: 17 suites, 85 tests pass
  • Frontend Vitest: 2 suites, 26 tests pass
  • Playwright E2E: 11 tests pass
  • TypeScript typecheck: clean (exit 0)
  • ESLint: 0 errors (876 pre-existing warnings)
  • npm audit: 0 vulnerabilities (root + backend)
  • Vite build: succeeds (5595 modules)

Generated with Devin

eesha264 and others added 12 commits July 30, 2026 23:47
# Conflicts:
#	src/components/landing/HeroSection.tsx
#	src/components/layout/MobileLayout.tsx
#	src/components/views/ActivityLogView.tsx
#	src/lib/utils.ts
…leanup

Task board live updates (no refresh needed):
- Forward getTaskIO through webhook queue to worker so GitHub push/PR
  transitions emit task-updated socket events to connected clients
- Add task-created + task-assigned socket emissions to both Kanban task
  creation routes (POST /steps/:stepId/tasks and POST /quick-task)
- Previously only task update/delete and the separate /api/tasks/assign
  route emitted socket events; creation required a manual refresh

Auth and response handling:
- Add missing Authorization: Bearer header to task create/update in
  ProjectDetails.tsx and task create in MobileProjectDetails.tsx
- Add response.ok check to task update handler with refetch + error toast

Security hardening:
- Protect /api/internal-metrics/metrics with authMiddleware (was public)
- Update puppeteer 24.x -> 25.6.0 to fix high-severity extract-zip
  symlink path traversal vulnerability (npm audit now clean)

Bug fixes:
- Fix ProjectTask sparse unique index collision: remove default: null
  from displayId and commitCode so sparse indexes skip unset fields
- Remove redundant Mongoose schema.index() calls in User.js and Team.js
  that caused duplicate index warnings on uid, email, and inviteCode
- Fix missing API_BASE_URL import in ArchitectureView.tsx (typecheck)
- Add missing braces after if statements in DesktopView/MobileView (lint)
- Fix flaky auth E2E test (navigate directly to /login with
  domcontentloaded instead of indirect navigation)
- Set Jest maxWorkers=1 to avoid jose ESM race condition under parallel
  workers

Cleanup:
- Delete 18 duplicate " 2" files tracked in git (source, docs, temp)

Tests:
- 85 backend tests pass (17 suites)
- 26 frontend vitest tests pass (2 suites)
- 11 Playwright E2E tests pass
- TypeScript typecheck clean
- ESLint 0 errors
- npm audit 0 vulnerabilities
- Vite build succeeds

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 13, 2026 08:38
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zync Ready Ready Preview Aug 13, 2026 9:05am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ChitkulLakshya
ChitkulLakshya enabled auto-merge (squash) August 13, 2026 08:51
…pdates-and-security-hardening

# Conflicts:
#	backend/package-lock.json
#	backend/package.json
#	src/components/zlam/ArchitectureView.tsx
@ChitkulLakshya
ChitkulLakshya merged commit 3cdfa1e into main Aug 13, 2026
4 of 5 checks passed
@ChitkulLakshya
ChitkulLakshya deleted the fix/task-board-live-updates-and-security-hardening branch August 13, 2026 09:05
@github-actions github-actions Bot added area:dependencies Package dependencies dependencies:lockfile area:backend Node.js backend code area:tests Test files and testing infrastructure area:backend-routes Backend API routes area:frontend React/web frontend code area:frontend-components React components area:config Configuration files labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Node.js backend code area:backend-models Backend data models area:backend-routes Backend API routes area:backend-services Backend services area:config Configuration files area:dependencies Package dependencies area:docs Documentation area:frontend React/web frontend code area:frontend-api area:frontend-components React components area:frontend-hooks React hooks area:frontend-pages Frontend pages/views area:frontend-services area:tests Test files and testing infrastructure dependencies:lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants