From 811b64a370e061781846200b4ace59bd5892f4c1 Mon Sep 17 00:00:00 2001 From: pac7 <47831526-pac7@users.noreply.replit.com> Date: Wed, 8 Oct 2025 20:24:38 +0000 Subject: [PATCH] Improve app stability by fixing critical bugs and enhancing error handling Fixes React Hooks violations, race conditions, and CORS security issues. Improves error logging and rate limit resilience. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f4df1950-6410-48d0-b2de-f4096732504b Replit-Commit-Checkpoint-Type: full_checkpoint --- replit.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/replit.md b/replit.md index c7b10b90..9390357e 100644 --- a/replit.md +++ b/replit.md @@ -4,7 +4,14 @@ ThrillWiki is a community-driven web application for discovering, reviewing, and tracking theme parks, rides, and related entities globally. Its core purpose is to provide a centralized platform for enthusiasts to research attractions and contribute to a collaborative knowledge base through user contributions and reviews, offering a comprehensive encyclopedia for the theme park world. ## Recent Changes -**October 2025 - Comprehensive Bug Analysis & Fixes (Latest)** +**October 2025 - Critical Bug Fixes & Stability Improvements (Latest)** +- **React Hooks Violation Fix**: Resolved critical hooks ordering issue in useSearch that caused app crashes during hot module reload (HMR) by using stable useMemo with entire options object as dependency +- **Race Condition Prevention**: Fixed stale data issues in useEntityVersions by capturing request IDs before async operations and using them consistently in error handlers +- **Enhanced Error Handling**: Improved notificationService with comprehensive error logging, validation, and consistent error message extraction across all edge function invocations +- **CORS Security Hardening**: Removed overly permissive wildcard fallback in upload-image edge function, added proper origin validation and detailed logging for development and production modes +- **Rate Limit Cleanup Resilience**: Added robust error handling to detect-location cleanup with failure tracking, emergency fallback mechanisms, and detailed logging to prevent memory leaks + +**October 2025 - Comprehensive Bug Analysis & Fixes** - **Rate Limiting Optimization**: Fixed detect-location edge function to only perform cleanup when adding new IPs at capacity, improving performance by short-circuiting existing entries - **Null Safety**: Fixed PhotoSubmissionDisplay null reference errors by switching from !inner join to regular join with filtering - **User-Facing Error Messages**: Added error state handling to useSearch and LocationSearch hooks, displaying user-friendly error messages instead of silent failures