Enhancing test coverage and device synchronization#7
Merged
Conversation
Agent-Logs-Url: https://github.com/JacinthaJanice/PrepPath/sessions/a5c56b8f-687f-4fcf-b153-e8e3852462ed Co-authored-by: JacinthaJanice <132421493+JacinthaJanice@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
JacinthaJanice
April 25, 2026 04:56
View session
… 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>
There was a problem hiding this comment.
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_tasksinstead oftasks. - 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.
Owner
|
Ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
realtime-sync.js:subscribeToTaskswas subscribing totaskstable — changed tocustom_tasksdatabase/supabase-schema.sql: correct journal columns (learnt/confused/gratitude/verse_reflection,entry_date), renametasks→custom_tasks, addupdated_attriggers for all tables, proper RLS policies, performance indexes, view commentsfrontend/config.js: changeBACKEND_URLdefault fromhttp://localhost:3001to''— api.js uses Supabase directly, so no backend is needed for cross-device sync (eliminates localhost error on other devices)days_until_septone-liner to readable helper with comments inbackend/server.jsandfrontend/api.js; now rolls forward to next year automatically after Septemberbackend/scripts/test-api.js: PATCH task (toggle done/undone, label update), DELETE task, 400 validation for missinglabel/project_id, journal upsert same-date, per-field stats key assertions, non-negativedays_until_septcheck