Fix/safari date parsing issue 642#660
Conversation
…h optimized for mobile viewport, supporting dynamic role redirection, accept/divert claiming, RAG overrides, CSAT stars, user clearance directories, and real-time settings sync
…enter webview video guides search overhaul
…epair profile logout, rename neural processing to AI triage
… error in AdminTicketDetailScreen
… function call in AdminUsersScreen
…gRocket Expo plugin to eliminate WARN
…s table, fix FlatList perf warning in AdminTicketDetailScreen
feat(monitoring): Set up Prometheus metrics and Grafana Dashboard for AI Inference Latency
feat(security): Implement transparent AES-256 GCM PII encryption for database tickets
feat(security): Implement AI-powered Spam and Phishing Detection for tickets and OCR
|
@Daksh7785 is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Problem Statement
Currently, Safari browsers (especially older versions) fail to parse certain standardized ISO-8601 timestamps returned from Supabase, leading to invalid date text (
NaN) or blanks on the Ticket Timeline.We need to normalize date formats before parsing them client-side. Specifically:
"2024-03-10 08:00:00") fail in older WebKit engines."2024-03-10T08:00:00.123") throw errors.null,undefined) or corrupt dates trigger page exceptions instead of defaulting gracefully.🛠️ Required Technical Implementation Steps & Fixes
1. Robust Date Normalizer (
safeParseDateStr)Refactored date helpers in
Frontend/src/utils/dateUtils.jsto introduce a robust date parser pipeline:T(Safari requirement).Zwhen no timezone offset (Z,+,-) exists to safely interpret it as UTC.new Date()) instead of breaking the UI.All 9 consumer files (
TicketTimeline,RecentTickets,MyTickets, etc.) remain completely untouched as all public API signatures (formatTimelineDate,getTimeZoneAbbr,formatFullTimestamp) are backward-compatible.2. Testing Framework Configuration
vite.config.jsto run in a lightweightjsdomenvironment.test,test:watch, andtest:uicommands topackage.json.🧪 Unit Tests & Verification
Created
Frontend/src/utils/dateUtils.test.jscovering 24 unique test assertions validating:Z)Z,+05:30,-08:00)IntlAPI🚀 Test Output Status
All 24 test assertions passed successfully:
RUN v2.1.9 C:/Users/ASUS/Desktop/666/HELPDESK.AI/Frontend ✓ src/utils/dateUtils.test.js (24 tests) 94ms Test Files 1 passed (1) Tests 24 passed (24) Start at 01:18:47 Duration 2.24s