Conversation
…, API, and database, while improving dashboard loading resilience and batch fetcher cache stability.
…date query cache settings
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bumps the repo to v4.3.6 and focuses on tightening academic-year data integrity (DB + APIs), adjusting sync behavior/caching on web, and improving mobile startup/data hydration + caching.
Changes:
- Added Supabase migrations to enforce academic year formatting and complete tracker UPDATE RLS.
- Reworked profile sync paths (web
/api/profile, sync service) including “light vs full” sync and debouncing. - Mobile startup/hydration + caching changes (disk cache for dashboard, new refresh params, request de-dupe/circuit-breaker tweaks), plus version bumps across web/mobile/OpenAPI/env.
Reviewed changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| supabase/migrations/20260522000000_harden_tracker_year_constraint_and_rls.sql | Adds tracker year format constraint and tracker UPDATE RLS policy. |
| supabase/migrations/20260521000000_harden_academic_year_null_checks.sql | Adds academic year and non-empty string constraints for class_courses/course_instructors. |
| src/proxy.ts | Allows forcing production Supabase selection via FORCE_PROD_SUPABASE. |
| src/lib/user/sync.ts | Refactors profile sync flow; introduces light/full sync results; adjusts class detection/upsert behavior. |
| src/lib/user/profile-bundle.ts | Allows reusing a pre-fetched user row when building the profile bundle. |
| src/lib/user/tests/sync.test.ts | Updates tests for changed class upsert selection and removal of class_courses migration behavior. |
| src/lib/supabase/fetch.ts | Respects FORCE_PROD_SUPABASE to disable dev overrides and proxy selection. |
| src/hooks/users/profile.ts | Changes React Query keying for profile hook. |
| src/hooks/use-sync-on-mount.ts | Introduces module-level de-duping/cooldown for sync-on-mount and a shared in-flight promise. |
| src/hooks/tracker/useTrackingData.ts | Reduces refetch churn by increasing stale/gc times and disabling interval refetch. |
| src/hooks/courses/courses.ts | Reduces refetch churn by increasing stale/gc times and disabling interval refetch. |
| src/hooks/tests/use-sync-on-mount.test.tsx | Adjusts tests to match new global in-flight sync behavior and module reset helper. |
| src/app/api/profile/route.ts | Reworks profile GET behavior: token resolution fallback, debounced full sync, bundle reuse, optional force. |
| src/app/api/profile/tests/route.test.ts | Updates mocks and test scaffolding for new profile route behavior. |
| src/app/api/cron/sync/route.ts | Refactors token-heal + attendance fetch; uses course_mappings to build a shared course map. |
| src/app/api/cron/sync/tests/route.test.ts | Mocks course_mappings access for cron sync tests. |
| src/app/api/courses/add/route.ts | Adds strict validation for semester and academicYear. |
| src/app/api/courses/add/tests/route.test.ts | Updates tests to match new semester/year validation formats. |
| src/app/api/auth/save-token/route.ts | Ensures Supabase session cookies are actually persisted (with non-fatal error handling). |
| src/app/api/auth/register-fcm/route.ts | Adds logging for Supabase auth.getUser failures. |
| src/app/actions/instructors.ts | Requires semester + academic year; validates formats before upsert. |
| src/app/actions/courses.ts | Requires semester + academic year; validates formats before insert. |
| src/app/actions/tests/instructors.test.ts | Updates tests for new required fields and normalized inputs. |
| src/app/actions/tests/courses.test.ts | Updates tests for new required fields and normalized inputs. |
| public/openapi/openapi.yaml | Bumps API version to 4.3.6. |
| package.json | Bumps web version to 4.3.6. |
| package-lock.json | Bumps lockfile version metadata to 4.3.6. |
| mobile/test/providers/auth_provider_analytics_test.dart | Updates API mock signatures and expectations for new refresh params/behavior. |
| mobile/test/logic/network_utils_test.dart | Changes expected hostname in certificate validation test. |
| mobile/test/coverage_shallow_test.dart | Adds SharedPreferences mock init and increases pump durations for stability. |
| mobile/test/coverage_booster_test.dart | Adds SharedPreferences mock init and adjusts pump timing. |
| mobile/test/auto_coverage_booster_test.dart | Adds additional pump delay for coverage booster stability. |
| mobile/pubspec.yaml | Bumps mobile version to 4.3.6+1. |
| mobile/lib/services/secure_storage.dart | Adds delete helpers for secure keys and cached entries. |
| mobile/lib/services/auth_service.dart | Adds force query param support for profile refresh. |
| mobile/lib/services/api_service.dart | Plumbs force through refreshProfile API. |
| mobile/lib/screens/tracking_screen.dart | Adds timeout to retry load of tracking provider. |
| mobile/lib/screens/splash_screen.dart | Runs integrity + auth initialization in parallel and adds additional startup delay/logging. |
| mobile/lib/screens/navigation_shell.dart | Adds timeout to outage recovery provider waits. |
| mobile/lib/screens/dashboard_screen.dart | Adds timeout to dashboard retry provider waits. |
| mobile/lib/screens/attendance_calendar_screen.dart | Adds timeout to calendar retry provider waits. |
| mobile/lib/providers/score_provider.dart | Parallelizes cache reads for exam question/answer data. |
| mobile/lib/providers/dashboard_provider.dart | Adds disk cache + silent revalidation + cache invalidation on refresh flows. |
| mobile/lib/providers/auth_provider.dart | Refactors startup hydration and refresh flow; adds force support; adjusts academic-change handling and provider invalidations. |
| mobile/lib/providers/academic_provider.dart | Avoids watching authProvider to prevent dependency loops; uses cached storage/profile fallback. |
| mobile/lib/logic/ezygo_batch_fetcher.dart | Adds generation-based cache invalidation to avoid caching after cache clears. |
| mobile/lib/config/app_config.dart | Updates default app version to 4.3.6. |
| .example.env | Bumps NEXT_PUBLIC_APP_VERSION and MIN_APP_VERSION to 4.3.6. |
Comments suppressed due to low confidence (1)
src/hooks/users/profile.ts:22
useProfile'squeryFnchanges behavior based onoptions?.sync, but thequeryKeyno longer includes that flag. This can cause React Query to serve a cached non-sync response whensynctoggles (or vice versa) and prevent the intended refetch. Includeoptions?.syncin thequeryKey(or otherwise ensure the cache key varies with the request params).
…o satisfy new Dart formats
…ic year constraints
devakesu-admin
previously approved these changes
May 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 49 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
src/hooks/users/profile.ts:22
useProfile'squeryFnbehavior depends onoptions?.sync(it conditionally adds?sync=true), but thequeryKeyno longer includes that flag. This can cause React Query to serve a cached non-sync response when a sync is requested (or vice versa) and may prevent refetching whenoptions.syncchanges. Includeoptions?.sync(or a stable boolean) in thequeryKey, or split into separate hooks/keys for sync vs non-sync fetches.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Devanarayanan <fusion@devakesu.com>
devakesu-admin
previously approved these changes
May 18, 2026
… clipping issues in service error dialog
devakesu-admin
approved these changes
May 18, 2026
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.
Pull Request
Description
feat: enforce academic year format and semester values across backend, API, and database, while improving dashboard loading resilience and batch fetcher cache stability.
chore: bump version to 4.3.6 and harden tracker table constraints and RLS policies
refactor: implement global sync throttling with shared promise and update query cache settings
fix: harden decryption error handling, sync promise types, and academic year constraints
Type of Change