Files
TimeTracker/docs/APPLY_FIXES_NOW.md
Dries Peeters e4789cc26e feat: Add telemetry and analytics infrastructure with observability stack
Implement comprehensive analytics and monitoring system with PostHog integration,
complete observability stack (Prometheus, Grafana, Loki, Promtail), and CI/CD
workflows for automated builds.

Features:
- Add PostHog telemetry integration with privacy-focused event tracking
- Implement installation flow for opt-in telemetry configuration
- Add telemetry management UI in admin panel with detailed transparency
- Track key user events across all major features (projects, tasks, timer, etc.)

Infrastructure:
- Set up Prometheus for metrics collection
- Configure Grafana for visualization dashboards
- Integrate Loki and Promtail for log aggregation
- Add separate analytics docker-compose configuration

CI/CD:
- Add GitHub Actions workflows for building and publishing Docker images
- Implement separate dev and production build pipelines
- Configure automated image publishing to registry

Documentation:
- Restructure documentation into organized docs/ directory
- Add comprehensive guides for telemetry, analytics, and local development
- Create transparency documentation for tracked events
- Add CI/CD and build configuration guides

Code improvements:
- Integrate telemetry hooks across all route handlers
- Add feature flags and configuration management
- Refactor test suite for analytics functionality
- Clean up root directory by moving docs and removing test artifacts

Breaking changes:
- Requires new environment variables for PostHog configuration
- Docker compose setup now supports analytics stack

Changes: 73 files changed, 955 insertions(+), 14126 deletions(-)
2025-10-20 14:38:57 +02:00

2.8 KiB

Apply These Changes NOW

Step 1: Restart the Application

The files have been updated with aggressive cache clearing. Now restart:

docker-compose restart app

Wait 10 seconds for restart, then proceed.

Step 2: Test Creating a Column

  1. Go to: http://your-domain/kanban/columns
  2. Click "Add Column"
  3. Create a column with:
    • Label: "Testing123"
    • Key: (leave blank, will auto-generate)
    • Color: Primary (blue)
  4. Click "Create Column"

Expected: You should see "Testing123" in the list

Step 3: Check the Kanban Board

  1. Open new tab
  2. Go to: http://your-domain/tasks
  3. Look at the kanban board

Expected: "Testing123" column should appear on the board

Step 4: If Still Not Working

Run these diagnostic commands:

# 1. Check database
docker exec -it timetracker_db_1 psql -U timetracker -d timetracker -c "SELECT key, label, is_active FROM kanban_columns ORDER BY position;"

# 2. Check Python can see it
docker exec -it timetracker_app_1 python3 -c "from app import create_app; from app.models import KanbanColumn; app = create_app(); app.app_context().push(); cols = KanbanColumn.get_active_columns(); print(f'Found {len(cols)} columns:'); [print(f'  - {c.label}') for c in cols]"

# 3. Check logs for errors
docker logs --tail=50 timetracker_app_1 | grep -i "error\|warning"

What Changed

I've added db.session.expire_all() before EVERY query for kanban columns:

  • In /tasks route
  • In /tasks/my-tasks route
  • In /projects/<id> route
  • In /kanban/columns route
  • In /api/kanban/columns endpoint
  • After every column modification

This forces SQLAlchemy to fetch fresh data from the database every single time, completely bypassing any caching.

Performance Note

This adds a tiny bit of overhead (< 1ms per request) but ensures fresh data always.

If STILL Not Working After Restart

Then the issue is one of these:

Issue 1: Changes Not Saving to Database

Check step 4.1 above. If your column isn't in the database, there's a form/validation issue.

Issue 2: Browser Caching

Press Ctrl+Shift+R (hard refresh) after creating column.

Issue 3: Multiple Database Instances

Unlikely, but check if you have multiple postgres containers:

docker ps | grep postgres

Should only show ONE container.

Issue 4: Permission Issues

Check Docker logs:

docker logs timetracker_app_1 2>&1 | tail -100

Look for "Permission denied" or "Access denied" errors.

Report Back

After restart and testing, tell me:

  1. Do you see your column in the database? (Step 4.1)
  2. Does Python see it? (Step 4.2)
  3. Do you see it on /kanban/columns page?
  4. Do you see it on /tasks page?
  5. Any errors in logs? (Step 4.3)

With these answers, I can pinpoint the exact issue!