Skip to content

Enhancing test coverage and device synchronization#7

Merged
JacinthaJanice merged 2 commits into
mainfrom
copilot/improve-test-coverage
Apr 25, 2026
Merged

Enhancing test coverage and device synchronization#7
JacinthaJanice merged 2 commits into
mainfrom
copilot/improve-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

  • Fix realtime-sync.js: subscribeToTasks was subscribing to tasks table — changed to custom_tasks
  • Rewrite database/supabase-schema.sql: correct journal columns (learnt/confused/gratitude/verse_reflection, entry_date), rename taskscustom_tasks, add updated_at triggers for all tables, proper RLS policies, performance indexes, view comments
  • Fix frontend/config.js: change BACKEND_URL default from http://localhost:3001 to '' — api.js uses Supabase directly, so no backend is needed for cross-device sync (eliminates localhost error on other devices)
  • Extract days_until_sept one-liner to readable helper with comments in backend/server.js and frontend/api.js; now rolls forward to next year automatically after September
  • Expand backend/scripts/test-api.js: PATCH task (toggle done/undone, label update), DELETE task, 400 validation for missing label/project_id, journal upsert same-date, per-field stats key assertions, non-negative days_until_sept check

Agent-Logs-Url: https://github.com/JacinthaJanice/PrepPath/sessions/a5c56b8f-687f-4fcf-b153-e8e3852462ed

Co-authored-by: JacinthaJanice <132421493+JacinthaJanice@users.noreply.github.com>
… date helper, test coverage

Agent-Logs-Url: https://github.com/JacinthaJanice/PrepPath/sessions/886d9577-21c0-475b-b94c-2dd31ff9035c

Co-authored-by: JacinthaJanice <132421493+JacinthaJanice@users.noreply.github.com>
Copilot AI requested a review from JacinthaJanice April 25, 2026 05:00
@JacinthaJanice JacinthaJanice marked this pull request as ready for review April 25, 2026 05:35
Copilot AI review requested due to automatic review settings April 25, 2026 05:35
@JacinthaJanice JacinthaJanice merged commit 5a058a4 into main Apr 25, 2026
2 checks passed
@JacinthaJanice JacinthaJanice deleted the copilot/improve-test-coverage branch April 25, 2026 05:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates PrepPath’s cross-device sync setup and strengthens backend API validation/testing, including aligning realtime subscriptions with the custom_tasks table and improving stats calculation readability.

Changes:

  • Fix Supabase realtime subscription to listen to custom_tasks instead of tasks.
  • Update stats computation (days_until_sept) in both frontend and backend to a named helper block.
  • Expand backend API test script coverage for tasks (PATCH/DELETE/400s), journal upsert, and stats assertions; refresh Supabase schema SQL.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
frontend/realtime-sync.js Switch realtime subscription target table to custom_tasks.
frontend/config.js Adjust default backend configuration and clarify Supabase-direct usage.
frontend/api.js Replace days_until_sept one-liner with a clearer helper calculation.
database/supabase-schema.sql Rewrite schema: table definitions, triggers, RLS policies, indexes, and views.
backend/server.js Replace days_until_sept one-liner with a clearer helper calculation.
backend/scripts/test-api.js Expand API test coverage for tasks/journal/stats and improve assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/api.js
Comment thread backend/server.js
Comment thread database/supabase-schema.sql
Comment thread database/supabase-schema.sql
Comment thread database/supabase-schema.sql
Comment thread database/supabase-schema.sql
Comment thread frontend/config.js
@JacinthaJanice
Copy link
Copy Markdown
Owner

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants