Commit Graph

63 Commits

Author SHA1 Message Date
gpt-engineer-app[bot]
88bcb00157 Fix Retry flashing and dependency validation 2025-10-09 17:55:58 +00:00
gpt-engineer-app[bot]
ff7c90e62d Fix edge function role check 2025-10-09 17:07:42 +00:00
gpt-engineer-app[bot]
cf31f94c44 Fix fetchItems calls and edge function error 2025-10-09 15:53:01 +00:00
gpt-engineer-app[bot]
1557def354 feat: Implement test data generation improvements 2025-10-09 14:49:54 +00:00
pac7
b580db3fb0 Improve error handling and stability across the application
Refactor error handling in `useEntityVersions` and `useSearch` hooks, enhance `NotificationService` with better error extraction and logging, and implement critical fallback mechanisms in the `detect-location` function's rate limit cleanup. Update CORS configuration in `upload-image` function for stricter origin checks and better security.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f4df1950-6410-48d0-b2de-f4096732504b
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 20:23:01 +00:00
pac7
13a4d8f64c Improve error handling and display for searches and uploads
Enhance user feedback by displaying search errors, refine photo submission fetching, add rate limiting cleanup logic, improve image upload cleanup, and strengthen moderator permission checks.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2741d09b-80fb-4f0a-bfd6-ababb2ac4bfc
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 19:55:55 +00:00
pac7
023f56eed7 Improve image upload functionality for authenticated users
Refactor `supabase/functions/upload-image/index.ts` to extract Supabase client creation into a new helper function `createAuthenticatedSupabaseClient`. This improves code organization and reusability by centralizing the logic for initializing an authenticated Supabase client using JWT authentication.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e0cbed76-4668-44f7-95b4-a456009b318d
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 19:40:07 +00:00
pac7
4bdbdac7c3 Improve form validation and image handling for entities
Refactor validation logic for 'founded_year' in multiple form components, enhance image cleanup in `EntityMultiImageUploader`, update `useEntityVersions` to prevent race conditions, improve error handling for recent searches in `useSearch`, refine rate limiting logic in `detect-location` Supabase function, and update CORS configuration for `upload-image` Supabase function.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b9af4867-23a7-43cc-baeb-4a97f66b4150
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 18:58:43 +00:00
pac7
ed7580fefc Update image upload to securely handle cross-origin requests
Refactor CORS configuration in the image upload Supabase function to implement environment-aware origin validation and allow-credentials for improved security.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 567218be-0199-4aaa-af7e-8307f67d4453
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 18:30:37 +00:00
pac7
3832439d67 Improve image upload and test data generation functionalities
Refactors `uploadPendingImages` to use `Promise.allSettled` for parallel uploads and implements JSON path queries in `clearTestData` and `getTestDataStats` for more robust test data management. Enhances `seed-test-data` function to support creating data conflicts and version chains, and adds validation for `imageId` format in `upload-image` function. Updates `AutocompleteSearch` to use a default search types constant.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: dc31cf9d-7a06-4420-8ade-e7b7f5200e71
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 18:14:34 +00:00
pac7
0f2219f849 Improve image handling, optimize hooks, and add rate limiting
This commit introduces several improvements:
- Enhances `RideModelCard` by safely accessing and displaying ride count and image data, preventing potential errors.
- Refactors `useEntityVersions` and `useSearch` hooks to use `useCallback` and improve performance and prevent race conditions.
- Introduces a `MAX_MAP_SIZE` and cleanup mechanism for the rate limiting map in `detect-location` Supabase function to prevent memory leaks.
- Adds robust error handling and cleanup for image uploads in `uploadPendingImages`.
- Modifies `ManufacturerModels` to correctly map and display ride counts.
- Includes error handling for topological sort in `process-selective-approval` Supabase function.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 39bb006b-d046-477f-a1f9-b7821836f3a1
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 17:55:37 +00:00
pac7
61285b0261 Add rate limiting to location detection and standardize error messages
Introduces rate limiting to the `detect-location` function and refactors error responses in `upload-image` to provide consistent, descriptive messages.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b3d7d4df-59a9-4a9c-971d-175b92dadbfa
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/b3d7d4df-59a9-4a9c-971d-175b92dadbfa/1VcvPNb
2025-10-08 17:18:00 +00:00
pac7
012f2995fa Improve error handling and input validation for notification preferences
Add input validation for userId and channelPreferences, and enhance error reporting for Novu API calls by returning detailed results for each channel update.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8c5cf3e-a80e-462f-b090-b081acdcf03a
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 14:05:36 +00:00
pac7
94631fd31b Update user notification preferences in Novu system
Modify the Supabase function to iterate through channel preferences and update each individually using the Novu SDK, including error handling for each channel update.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8c5cf3e-a80e-462f-b090-b081acdcf03a
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 14:02:03 +00:00
pac7
543e7fe81e Improve error handling and data assignment in test data seeding
Fixes TypeScript errors in the seed data edge function by correctly assigning `userId` instead of `user.id` and safely accessing error messages.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8c5cf3e-a80e-462f-b090-b081acdcf03a
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 13:56:00 +00:00
pac7
aee512b8a1 Improve security by auditing service role key usage in edge functions
Audit and document the usage of service role keys in multiple Supabase edge functions (cancel-email-change, process-selective-approval, seed-test-data) to ensure secure and scoped access.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: fe5b902e-beda-40fc-bf87-a3c4ab300e3a
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:56:58 +00:00
pac7
2b1dcd70ef Improve error reporting for location detection to include status codes
Update the detect-location Supabase function to return a 500 status code and an error message on failure, improving debugging and error monitoring.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: fe5b902e-beda-40fc-bf87-a3c4ab300e3a
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:53:14 +00:00
pac7
32a83013e5 Update email cancellation and location detection functions
Refactor Supabase function to use explicit JWT verification via auth.getUser, and enhance the location detection function with configurable geolocation API endpoints.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 364fb426-1d27-49b2-a244-a34e41c335e4
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:32:19 +00:00
pac7
2fc78cbde5 Improve error handling and dependency checks for data processing
Address issues in FieldHistoryDialog by clearing changes on error, enhance useEntityVersions to provide default profiles for missing users, add localStorage availability check in useLocationAutoDetect, and improve dependency resolution logic in supabase/functions/process-selective-approval.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 334e80ad-8f74-4e3a-acec-6dd811858e98
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:23:22 +00:00
pac7
163b721271 Improve email sending by adding error handling and fixing security
Add try-catch blocks to Supabase functions for robust error handling during email sending and response processing.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a46bc7a0-bbf8-43ab-97c0-a58c66c2e365
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:07:42 +00:00
pac7
0b57cba16f Improve security and error handling in backend functions
Update Supabase functions for cancel-email-change, detect-location, send-escalation-notification, and upload-image to enhance security and implement robust error handling.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a46bc7a0-bbf8-43ab-97c0-a58c66c2e365
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:06:35 +00:00
pac7
ccea99fecd Securely handle email change cancellations and improve Supabase function error handling
Update supabase/functions/cancel-email-change/index.ts to use secure base64 decoding for JWTs and enhance error handling for Supabase functions.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a46bc7a0-bbf8-43ab-97c0-a58c66c2e365
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-08 12:04:35 +00:00
pac7
b8787ee6de Improve security by verifying user authentication and authorization
Update the 'process-selective-approval' Supabase function to enforce authentication and authorization checks before processing requests. Also, modify the 'upload-image' function to prevent banned users from uploading images. Additionally, enable future React Router v7 features for enhanced navigation.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 6d6e48da-5b1b-47f9-a65c-9fa4a352936a
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/6d6e48da-5b1b-47f9-a65c-9fa4a352936a/u05utRo
2025-10-07 20:12:39 +00:00
pac7
6737431379 Improve error handling and navigation safety across the application
Add robust error handling for image uploads, improve navigation logic in AutocompleteSearch with toast notifications for missing identifiers, refine useIsMobile hook return type, and update Supabase function error reporting to handle non-Error types.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a759d451-40bf-440d-96f5-a19ad6af18a8
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-07 15:25:37 +00:00
pac7
88ed3207c4 Improve error handling and authentication for uploads and notifications
Refactor PhotoUpload component to fetch session token before polling, enhance error handling in NotificationService and versioningHelpers with `instanceof Error` checks, and add comprehensive validation for request body fields in the create-novu-subscriber Supabase function.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 8d708ff6-09f1-4b67-8edc-de3fcb2349b3
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-07 14:55:35 +00:00
pac7
f4020969d8 Add authentication to image upload and status checking endpoints
Implement JWT-based authentication for POST (upload) and GET (status check) requests to the image handling functions, verifying user identity via Supabase Auth.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 8d708ff6-09f1-4b67-8edc-de3fcb2349b3
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
2025-10-07 14:52:37 +00:00
pac7
1addcbc0dd Improve error handling and environment configuration across the application
Enhance input validation, update environment variable usage for Supabase and Turnstile, and refine image upload and auth logic for better robustness and developer experience.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cb061c75-702e-4b89-a8d1-77a96cdcdfbb
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7cdf4e95-3f41-4180-b8e3-8ef56d032c0e/cb061c75-702e-4b89-a8d1-77a96cdcdfbb/ANdRXVZ
2025-10-07 14:42:22 +00:00
gpt-engineer-app[bot]
2f71312f7c Implement Test Data Generator 2025-10-06 18:48:24 +00:00
gpt-engineer-app[bot]
fae8542c45 Fix: Correct RLS policies and function security 2025-10-06 16:50:00 +00:00
gpt-engineer-app[bot]
2750d285cb Refactor photo modification logic 2025-10-02 17:46:45 +00:00
gpt-engineer-app[bot]
9726df6606 Fix duplicate variable declaration 2025-10-02 17:35:06 +00:00
gpt-engineer-app[bot]
8ba049024e Fix form photo upload to photos table 2025-10-02 17:32:42 +00:00
gpt-engineer-app[bot]
0793793d89 Fix: Normalize status in edge function 2025-10-02 17:24:50 +00:00
gpt-engineer-app[bot]
d4d7da977a Fix: Filter database fields in edge function 2025-10-02 17:19:15 +00:00
gpt-engineer-app[bot]
ae74fa5677 Refactor: Update edge function for counts 2025-10-02 16:40:37 +00:00
gpt-engineer-app[bot]
ae84732326 Fix date field handling in forms and edge function 2025-10-02 16:27:13 +00:00
gpt-engineer-app[bot]
dfc697b002 Fix image assignment in edge function 2025-10-02 15:28:17 +00:00
gpt-engineer-app[bot]
0530e27c1a feat: Cascade moderation actions to submission items 2025-10-02 15:15:45 +00:00
gpt-engineer-app[bot]
882d06b70f Fix: Bypass Supabase Auth API issues in edge function 2025-10-01 16:22:20 +00:00
gpt-engineer-app[bot]
cc4da9f8ad Fix: Ensure authorization header is sent 2025-10-01 16:19:57 +00:00
gpt-engineer-app[bot]
11e6b2bf46 Fix edge function and force session refresh 2025-10-01 16:14:59 +00:00
gpt-engineer-app[bot]
50273ed620 Implement PostgreSQL function to cancel email change 2025-10-01 16:09:32 +00:00
gpt-engineer-app[bot]
9ab59e9025 Fix: Properly cancel email changes via direct DB manipulation 2025-10-01 16:03:04 +00:00
gpt-engineer-app[bot]
de284a4328 Fix edge function to clear new_email 2025-10-01 15:59:52 +00:00
gpt-engineer-app[bot]
13626922cc feat: Create edge function to cancel email changes 2025-10-01 15:57:30 +00:00
gpt-engineer-app[bot]
b52d326f7b Update Novu migration to include username 2025-10-01 14:10:14 +00:00
gpt-engineer-app[bot]
18669a4e6c feat: Implement Novu username and update functionality 2025-10-01 14:01:44 +00:00
gpt-engineer-app[bot]
549b964b60 Fix Novu migration utility query 2025-10-01 13:22:08 +00:00
gpt-engineer-app[bot]
e2f0df22cc feat: Implement Novu notification system 2025-10-01 12:26:12 +00:00
gpt-engineer-app[bot]
db792c7011 Fix ForwardEmail authentication 2025-09-30 21:16:11 +00:00