Skip to content

v4.3.6#638

Merged
devakesu merged 11 commits into
mainfrom
4.3.6
May 18, 2026
Merged

v4.3.6#638
devakesu merged 11 commits into
mainfrom
4.3.6

Conversation

@devakesu
Copy link
Copy Markdown
Owner

@devakesu devakesu commented May 18, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test update

devakesu added 3 commits May 18, 2026 19:49
…, API, and database, while improving dashboard loading resilience and batch fetcher cache stability.
Copilot AI review requested due to automatic review settings May 18, 2026 19:57
Copy link
Copy Markdown
Contributor

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

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's queryFn changes behavior based on options?.sync, but the queryKey no longer includes that flag. This can cause React Query to serve a cached non-sync response when sync toggles (or vice versa) and prevent the intended refetch. Include options?.sync in the queryKey (or otherwise ensure the cache key varies with the request params).

Comment thread src/hooks/use-sync-on-mount.ts Outdated
Comment thread src/lib/user/sync.ts Outdated
Comment thread src/app/api/profile/route.ts
Comment thread mobile/lib/screens/splash_screen.dart
Comment thread mobile/test/logic/network_utils_test.dart
Copilot AI review requested due to automatic review settings May 18, 2026 20:12
devakesu-admin
devakesu-admin previously approved these changes May 18, 2026
@devakesu devakesu enabled auto-merge (squash) May 18, 2026 20:16
Copy link
Copy Markdown
Contributor

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

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's queryFn behavior depends on options?.sync (it conditionally adds ?sync=true), but the queryKey no 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 when options.sync changes. Include options?.sync (or a stable boolean) in the queryKey, or split into separate hooks/keys for sync vs non-sync fetches.

Comment thread src/hooks/use-sync-on-mount.ts
Comment thread src/hooks/use-sync-on-mount.ts Outdated
Comment thread mobile/lib/screens/splash_screen.dart
Comment thread mobile/lib/screens/splash_screen.dart
Comment thread mobile/test/logic/network_utils_test.dart Outdated
Comment thread src/lib/user/sync.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Devanarayanan <fusion@devakesu.com>
Copilot AI review requested due to automatic review settings May 18, 2026 20:25
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

devakesu-admin
devakesu-admin previously approved these changes May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 20:41
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@devakesu devakesu merged commit a1517a7 into main May 18, 2026
9 of 10 checks passed
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