Commit Graph

333 Commits

Author SHA1 Message Date
gpt-engineer-app[bot]
b917232220 Refactor useModerationActions for resilience
Integrate transaction resilience features into the `useModerationActions` hook by refactoring the `invokeWithIdempotency` function. This change ensures that all moderation paths, including approvals, rejections, and retries, benefit from timeout detection, automatic lock release, and robust idempotency key management. The `invokeWithIdempotency` function has been replaced with a new `invokeWithResilience` function that incorporates these enhancements.
2025-11-07 15:53:54 +00:00
gpt-engineer-app[bot]
34dbe2e262 Implement Phase 4: Transaction Resilience
This commit implements Phase 4 of the Sacred Pipeline, focusing on transaction resilience. It introduces:

- **Timeout Detection & Recovery**: New utilities in `src/lib/timeoutDetection.ts` to detect, categorize (minor, moderate, critical), and provide recovery strategies for timeouts across various sources (fetch, Supabase, edge functions, database). Includes a `withTimeout` wrapper.
- **Lock Auto-Release**: Implemented in `src/lib/moderation/lockAutoRelease.ts` to automatically release submission locks on error, timeout, abandonment, or inactivity. Includes mechanisms for unload events and inactivity monitoring.
- **Idempotency Key Lifecycle Management**: A new module `src/lib/idempotencyLifecycle.ts` to track idempotency keys through their states (pending, processing, completed, failed, expired) using IndexedDB. Includes automatic cleanup of expired keys.
- **Enhanced Idempotency Helpers**: Updated `src/lib/idempotencyHelpers.ts` to integrate with the new lifecycle management, providing functions to generate, register, validate, and update the status of idempotency keys.
- **Transaction Resilience Hook**: A new hook `src/hooks/useTransactionResilience.ts` that combines timeout handling, lock auto-release, and idempotency key management for robust transaction execution.
- **Submission Queue Integration**: Updated `src/hooks/useSubmissionQueue.ts` to leverage the new submission queue and idempotency lifecycle functionalities.
- **Documentation**: Added `PHASE4_TRANSACTION_RESILIENCE.md` detailing the implemented features and their usage.
2025-11-07 15:03:12 +00:00
gpt-engineer-app[bot]
095278dafd Implement client-side resilience UI
Create NetworkErrorBanner, SubmissionQueueIndicator, and enhanced retry progress UI components. Integrate them into the application using a ResilienceProvider to manage network status and submission queue states. Update App.tsx to include the ResilienceProvider.
2025-11-07 14:54:06 +00:00
gpt-engineer-app[bot]
e747e1f881 Implement RLS and security functions
Apply Row Level Security to orphaned_images and system_alerts tables. Create RLS policies for admin/moderator access. Replace system_health view with get_system_health() function.
2025-11-07 01:02:58 +00:00
gpt-engineer-app[bot]
b92a62ebc8 feat: Add idempotency to useModerationActions
Implement idempotency integration in the useModerationActions hook as per the detailed plan.
2025-11-06 17:43:16 +00:00
gpt-engineer-app[bot]
e7f5aa9d17 Refactor validation to edge function
Centralize all business logic validation within the edge function for the submission pipeline. Remove validation logic from React hooks, retaining only basic UX validation (e.g., checking for empty fields). This ensures a single source of truth for validation, preventing inconsistencies between the frontend and backend.
2025-11-06 16:18:34 +00:00
gpt-engineer-app[bot]
41a396b063 Fix parenthesis error in moderation actions
Fix missing closing parenthesis in `src/hooks/moderation/useModerationActions.ts` to resolve the build error.
2025-11-06 15:49:49 +00:00
gpt-engineer-app[bot]
5b0ac813e2 Fix park submission locations
Implement Phase 1 of the JSONB violation fix by creating the `park_submission_locations` table. This includes migrating existing data from `park_submissions.temp_location_data` and updating relevant code to read and write to the new relational table. The `temp_location_data` column will be dropped after data migration.
2025-11-06 15:45:12 +00:00
gpt-engineer-app[bot]
dcdf502e67 Fix 406 error in company lookup 2025-11-06 02:32:19 +00:00
gpt-engineer-app[bot]
2b56629a75 Add logging for submission data 2025-11-06 00:04:07 +00:00
gpt-engineer-app[bot]
d00c4f2e92 Fix location validation in moderation 2025-11-05 23:53:27 +00:00
gpt-engineer-app[bot]
fa3dfcfdee Fix: Improve chunk load error handling 2025-11-05 21:23:09 +00:00
gpt-engineer-app[bot]
7476fbd5da feat: Add park selection to RideForm 2025-11-05 21:18:26 +00:00
gpt-engineer-app[bot]
c8018b827e feat: Implement retry logic and tracking 2025-11-05 20:19:43 +00:00
gpt-engineer-app[bot]
5e4ed810c0 feat: Add error boundaries to submission queries 2025-11-05 20:05:01 +00:00
gpt-engineer-app[bot]
4ee6419865 Fix ambiguous relationship queries 2025-11-05 19:55:36 +00:00
gpt-engineer-app[bot]
ba974d2243 Fix validation for non-park/ride entities 2025-11-05 19:09:18 +00:00
gpt-engineer-app[bot]
d29e873e14 feat: Implement comprehensive validation error handling 2025-11-05 19:00:28 +00:00
gpt-engineer-app[bot]
882959bce6 Refactor: Use consolidated escalateSubmission action 2025-11-05 18:49:21 +00:00
gpt-engineer-app[bot]
0d6d3fb2cc feat: Implement timeline manager 2025-11-05 18:44:57 +00:00
gpt-engineer-app[bot]
80d823a1b9 Fix moderation queue claim logic 2025-11-05 16:37:54 +00:00
gpt-engineer-app[bot]
1f93e7433b feat: Implement automatic API connectivity banner 2025-11-05 15:55:02 +00:00
gpt-engineer-app[bot]
09de0772ea Refactor: Improve Cronitor health check error handling 2025-11-05 15:42:43 +00:00
gpt-engineer-app[bot]
35fdd16c6c feat: Implement Cronitor health monitor 2025-11-05 15:38:11 +00:00
gpt-engineer-app[bot]
e08aacaff3 Refactor: Remove circuit breaker system 2025-11-05 15:02:17 +00:00
gpt-engineer-app[bot]
e773ca58d1 feat: Implement network status banner 2025-11-05 14:12:23 +00:00
gpt-engineer-app[bot]
540bd1cd7a Fix unstable callbacks in moderation queue 2025-11-05 05:00:23 +00:00
gpt-engineer-app[bot]
fcf5b9dba3 Fix: Remove restoreActiveLock from useEffect dependency 2025-11-05 04:53:27 +00:00
gpt-engineer-app[bot]
e799216fbc Fix useCallback in useUserRole hook 2025-11-05 04:37:56 +00:00
gpt-engineer-app[bot]
eb726d3f83 Fix infinite query loop 2025-11-05 01:55:53 +00:00
gpt-engineer-app[bot]
6438d186d7 Fix infinite query loop 2025-11-05 01:35:59 +00:00
gpt-engineer-app[bot]
5985ee352d Fix error handling 2025-11-05 00:54:12 +00:00
gpt-engineer-app[bot]
c4f975ff12 Implement persistent lock state 2025-11-04 23:12:44 +00:00
gpt-engineer-app[bot]
16386f9894 Implement superuser lock management 2025-11-04 23:08:00 +00:00
gpt-engineer-app[bot]
a9334c7a3a Implement Phase 3C error logging 2025-11-04 19:39:55 +00:00
gpt-engineer-app[bot]
162d288cb0 feat: Complete error logging coverage 2025-11-04 19:30:56 +00:00
gpt-engineer-app[bot]
6e64b80106 feat: Implement comprehensive error logging 2025-11-04 19:04:06 +00:00
gpt-engineer-app[bot]
2deab69ebe Fix Supabase client proxy 2025-11-04 17:37:30 +00:00
gpt-engineer-app[bot]
87589ee08f feat: Implement comprehensive error handling 2025-11-04 17:34:16 +00:00
gpt-engineer-app[bot]
80aa033e70 Fix submission_items foreign keys 2025-11-04 14:57:58 +00:00
gpt-engineer-app[bot]
949b502ec0 Fix interval parameter format 2025-11-04 01:20:41 +00:00
gpt-engineer-app[bot]
26e5ca6dbe Fix RPC call transaction mode 2025-11-04 01:17:14 +00:00
gpt-engineer-app[bot]
71b174fe16 Fix: Use RPC for submission claims 2025-11-04 00:32:39 +00:00
gpt-engineer-app[bot]
5542ee52f7 Fix Supabase OR filter syntax 2025-11-04 00:15:18 +00:00
gpt-engineer-app[bot]
ec7fae3d86 Fix and test error logging 2025-11-03 22:19:27 +00:00
gpt-engineer-app[bot]
6af981a6e4 Fix imports and test flow 2025-11-03 22:03:08 +00:00
gpt-engineer-app[bot]
63d9d8890c Fix frontend JSONB references 2025-11-03 21:19:51 +00:00
gpt-engineer-app[bot]
6fbaf0c606 Fix edge function logging and types 2025-11-03 19:57:27 +00:00
gpt-engineer-app[bot]
7663205512 Fix remaining compliance violations 2025-11-03 18:47:59 +00:00
gpt-engineer-app[bot]
7eb0b77d76 Fix console statement violations 2025-11-03 18:30:07 +00:00