Commit Graph

80 Commits

Author SHA1 Message Date
gpt-engineer-app[bot]
96adb2b15e Connect to Lovable Cloud
Implement distributed tracing across edge functions:
- Introduce span types and utilities (logger.ts enhancements)
- Replace request tracking with span-based tracing in approval and rejection flows
- Propagate and manage W3C trace context in edge tracking
- Add span visualization scaffolding (spanVisualizer.ts) and admin TraceViewer UI (TraceViewer.tsx)
- Create tracing-related type definitions and support files
- Prepare RPC call logging with span context and retries
2025-11-10 14:40:44 +00:00
gpt-engineer-app[bot]
1551a2f08d Add structured moderation logging
Enhance edge functions process-selective-approval and process-selective-rejection with edgeLogger-based, structured logging. Introduce request tracking (startRequest/endRequest), replace all console logs, add comprehensive logging points (auth, payload validation, idempotency, RPC calls, deadlocks, errors, locks), and register process-selective-rejection in config.toml. Also sanitize sensitive data in logs and ensure duration metrics are captured.
2025-11-10 14:32:37 +00:00
Claude
571bf07b84 Fix critical error handling gaps in submission pipeline
Addressed real error handling issues identified during comprehensive
pipeline review:

1. **process-selective-approval edge function**
   - Added try-catch blocks around idempotency key updates (lines 216-262)
   - Prevents silent failures when updating submission status tracking
   - Updates are now non-blocking to ensure proper response delivery

2. **submissionItemsService.ts**
   - Added error logging before throwing in fetchSubmissionItems (line 75-81)
   - Added error handling for park location fetch failures (lines 99-107)
   - Location fetch errors are now logged as non-critical and don't block
     submission item retrieval

3. **notify-moderators-submission edge function**
   - Added error handling for notification log insert (lines 216-236)
   - Log failures are now non-blocking and properly logged
   - Ensures notification delivery isn't blocked by logging issues

4. **upload-image edge function**
   - Fixed CORS headers scope issue (line 127)
   - Moved corsHeaders definition outside try block
   - Prevents undefined reference in catch block error responses

All changes maintain backward compatibility and improve pipeline
resilience without altering functionality. Error handling is now
consistent with non-blocking patterns for auxiliary operations.
2025-11-08 03:47:54 +00:00
gpt-engineer-app[bot]
bdea5f0cc4 Fix timeline event updates and edge function
Update `update_entity_from_submission` and `delete_entity_from_submission` to support timeline events. Remove unused `p_idempotency_key` parameter from `process_approval_transaction` RPC call in `process-selective-approval` edge function.
2025-11-08 02:56:40 +00:00
gpt-engineer-app[bot]
13c6e20f11 Implement Phase 2 improvements
Implement slug uniqueness constraints, foreign key validation, and rate limiting.
2025-11-06 23:59:48 +00:00
gpt-engineer-app[bot]
24dbf5bbba Implement critical fixes
Approve and implement Phase 1 critical fixes including CORS, RPC rollback, idempotency, timeouts, and deadlock retry.
2025-11-06 21:51:39 +00:00
gpt-engineer-app[bot]
bd2f9a5a9e Remove old approval flow
Implement the destructive migration plan to remove the old approval flow entirely. This includes deleting the legacy edge function, removing the toggle component, simplifying frontend code, and updating documentation.
2025-11-06 21:14:59 +00:00
gpt-engineer-app[bot]
5217102ded Fix session variable pollution
Implement all phases to fix session variable pollution by changing `is_local` to `true` in the `create_submission_with_items` database function and the `process-selective-approval` edge function. This ensures session variables are transaction-scoped, preventing data corruption and attribution errors. Includes database migration, edge function updates, and monitoring for attribution mismatches.
2025-11-06 19:46:51 +00:00
gpt-engineer-app[bot]
5c1fbced45 Fix high priority pipeline issues
Implement orphaned image cleanup, temp refs cleanup, deadlock retry, and lock cleanup. These fixes address critical areas of data integrity, resource management, and system resilience within the submission pipeline.
2025-11-06 18:54:47 +00:00
gpt-engineer-app[bot]
85436b5c1e feat: Integrate idempotency
Implement idempotency for the process-selective-approval edge function as per the detailed plan.
2025-11-06 17:24:21 +00:00
gpt-engineer-app[bot]
1cc80e0dc4 Fix edge function transaction boundaries
Wrap edge function approval loop in database transaction to prevent partial data on failures. This change ensures atomicity for approval operations, preventing inconsistent data states in case of errors.
2025-11-06 16:11:52 +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]
bd4f75bfb2 Fix entity submission pipelines
Refactor park updates, ride updates, and timeline event submissions to use dedicated relational tables instead of JSON blobs in `submission_items.item_data`. This enforces the "NO JSON IN SQL" rule, improving queryability, data integrity, and consistency across the pipeline.
2025-11-06 15:13:36 +00:00
gpt-engineer-app[bot]
ed9d17bf10 Fix ride model technical specs
Implement plan to fix ride model technical specifications pipeline. This includes creating a new migration for the `ride_model_submission_technical_specifications` table, updating `entitySubmissionHelpers.ts` to handle insertion of technical specifications, and modifying the edge function `process-selective-approval/index.ts` to fetch these specifications. This ensures no data loss for ride model technical specifications.
2025-11-06 15:03:51 +00:00
gpt-engineer-app[bot]
de9a48951f Fix ride submission data loss
Implement the plan to fix critical data loss in ride submissions. This includes:
- Storing ride technical specifications, coaster statistics, and name history in submission tables.
- Adding missing category-specific fields to the `ride_submissions` table via a new migration.
- Updating submission helpers and the edge function to include these new fields.
- Fixing the park location Zod schema to include `street_address`.
2025-11-06 14:51:36 +00:00
gpt-engineer-app[bot]
9f5240ae95 Fix: Add street_address to composite submission approval
Implement the plan to add `street_address` to the location creation logic within the `process-selective-approval` edge function. This ensures that `street_address` is preserved when approving composite submissions, completing the end-to-end pipeline for this field.
2025-11-06 14:24:48 +00:00
gpt-engineer-app[bot]
b189f40c1f Fix date display and edit form issues 2025-11-06 05:01:51 +00:00
gpt-engineer-app[bot]
328a77a0a8 Fix: Normalize park_type in approval function 2025-11-06 04:50:48 +00:00
gpt-engineer-app[bot]
93e48ac457 Fix park type and moderator ID 2025-11-06 04:31:58 +00:00
gpt-engineer-app[bot]
090f6aca48 Refactor: Redeploy edge function 2025-11-06 04:25:29 +00:00
gpt-engineer-app[bot]
dfd17e8244 Refactor park submission location handling 2025-11-05 20:46:02 +00:00
gpt-engineer-app[bot]
f9c11cb064 Fix: Improve validation error handling 2025-11-05 20:36:02 +00:00
gpt-engineer-app[bot]
028ea433bb Fix edge function query ambiguity 2025-11-05 20:09:44 +00:00
gpt-engineer-app[bot]
bd3bffcc20 Fix edge function errors 2025-11-05 19:40:35 +00:00
gpt-engineer-app[bot]
bdd4e046f5 Fix: Resolve edge function auth error 2025-11-05 19:23:25 +00:00
gpt-engineer-app[bot]
435ddf476b Fix edge function bundle timeout 2025-11-05 19:16:31 +00:00
gpt-engineer-app[bot]
e8fc479b10 Fix duplicate variable declaration 2025-11-05 19:12:48 +00:00
gpt-engineer-app[bot]
d62b3c2412 feat: Implement temp ref cleanup 2025-11-05 18:15:21 +00:00
gpt-engineer-app[bot]
b036fb4785 Add temp ref cleanup 2025-11-05 18:09:44 +00:00
gpt-engineer-app[bot]
ba6bb8a317 Fix edge function console statements 2025-11-03 19:16:06 +00:00
gpt-engineer-app[bot]
fdfe141f31 feat: Implement security fix plan 2025-11-03 15:50:07 +00:00
gpt-engineer-app[bot]
8d6cf9ceb5 Refactor submission data handling 2025-11-03 14:09:16 +00:00
gpt-engineer-app[bot]
db8029f573 Refactor submission items 2025-11-03 03:55:38 +00:00
gpt-engineer-app[bot]
bb951e637f Refactor composite submission logic 2025-11-02 20:29:08 +00:00
gpt-engineer-app[bot]
6a9df807fa Fix submission flow issues 2025-11-02 20:21:10 +00:00
gpt-engineer-app[bot]
0a9820abfb Fix composite submission dependency resolution 2025-11-02 19:56:23 +00:00
gpt-engineer-app[bot]
fe76c8c572 feat: Implement comprehensive ban enforcement 2025-10-30 01:47:51 +00:00
gpt-engineer-app[bot]
2de13c12e4 feat: Implement comprehensive audit logging 2025-10-27 17:14:24 +00:00
gpt-engineer-app[bot]
d74ece69ee Refactor: Complete JSONB elimination 2025-10-21 17:52:13 +00:00
gpt-engineer-app[bot]
827f0f8ea5 Fix: Address HMR failures and Fast Refresh incompatibility 2025-10-21 13:13:10 +00:00
gpt-engineer-app[bot]
638d49c8d9 Update plan with remaining phases 2025-10-21 12:25:36 +00:00
gpt-engineer-app[bot]
d886343398 Add edge function logging 2025-10-21 11:56:07 +00:00
gpt-engineer-app[bot]
6f1baef8c0 Approve tool use 2025-10-20 12:58:09 +00:00
gpt-engineer-app[bot]
4983960138 Fix remaining production readiness issues 2025-10-20 12:30:09 +00:00
gpt-engineer-app[bot]
84188b94f2 Fix: Enable edit functionality for ride models and timeline events 2025-10-19 22:39:01 +00:00
gpt-engineer-app[bot]
5a138688bc Fix validation for edits 2025-10-19 17:37:47 +00:00
gpt-engineer-app[bot]
459f917aa3 Fix: Remove broken getSession() call 2025-10-18 00:00:09 +00:00
gpt-engineer-app[bot]
7ba954e0cb Refactor: Add logging for getUser() failure 2025-10-17 23:52:49 +00:00
gpt-engineer-app[bot]
1d68accf05 Fix: Force redeploy edge function 2025-10-17 23:49:45 +00:00
gpt-engineer-app[bot]
8a36c71edb Fix: Implement MFA enforcement and critical bug fix 2025-10-17 19:43:43 +00:00