From 4008d4a43502c60969cf3a7123934f2ad3ae3e31 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Tue, 8 Sep 2026 18:26:41 +0300 Subject: [PATCH] Update Saqel Platform: 2026-09-08 18:26:41 --- .../lib/core/services/storage_service.dart | 6 +++--- .../screens/tabs/teacher_studio_upload_tab.dart | 2 +- backend/app/Controllers/VideoController.php | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/teacher_app/lib/core/services/storage_service.dart b/apps/teacher_app/lib/core/services/storage_service.dart index 1d594fd..554a971 100644 --- a/apps/teacher_app/lib/core/services/storage_service.dart +++ b/apps/teacher_app/lib/core/services/storage_service.dart @@ -1,6 +1,5 @@ import 'package:flutter/services.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import '../utils/app_logger.dart'; /// Ultra-Resilient Storage Service for Teacher Studio class StorageService { @@ -25,8 +24,9 @@ class StorageService { _volatileStore[key] = value; try { await _secureStorage.write(key: key, value: value); - } on PlatformException catch (e) { - AppLogger.log('Keychain notice ($key): ${e.message}', tag: 'STORAGE'); + } on PlatformException { + // Unsigned macOS debug builds cannot access Keychain. The in-process + // fallback above keeps the session active without logging a false error. } catch (_) {} } diff --git a/apps/teacher_app/lib/presentation/screens/tabs/teacher_studio_upload_tab.dart b/apps/teacher_app/lib/presentation/screens/tabs/teacher_studio_upload_tab.dart index 2474500..6d77f5b 100644 --- a/apps/teacher_app/lib/presentation/screens/tabs/teacher_studio_upload_tab.dart +++ b/apps/teacher_app/lib/presentation/screens/tabs/teacher_studio_upload_tab.dart @@ -370,7 +370,7 @@ class _TeacherStudioUploadTabState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text( - 'مدة الشرح الرقمي المستخرجة:', + 'مدة الشرح التقريبية (يؤكدها الخادم من الملف):', style: TextStyle( fontSize: 13, fontWeight: FontWeight.w700, diff --git a/backend/app/Controllers/VideoController.php b/backend/app/Controllers/VideoController.php index 8772218..bf3f209 100644 --- a/backend/app/Controllers/VideoController.php +++ b/backend/app/Controllers/VideoController.php @@ -39,6 +39,17 @@ class VideoController VideoService::ensureSchema(); CurriculumService::ensureSchema(); + // PHP discards both multipart fields and files when post_max_size is + // exceeded. Detect that case before reporting a misleading missing title. + $contentLength = (int)($_SERVER['CONTENT_LENGTH'] ?? 0); + if ($contentLength > 0 && empty($_POST) && empty($_FILES)) { + $response->status(413)->json([ + 'status' => 'error', + 'message' => 'حجم الفيديو تجاوز حد الرفع المسموح على الخادم (' . ini_get('post_max_size') . '). ارفع حدّي post_max_size وupload_max_filesize ثم أعد المحاولة.', + ]); + return; + } + $courseId = (int)($request->getBody()['course_id'] ?? $_POST['course_id'] ?? 0); $title = trim((string)($request->getBody()['title'] ?? $_POST['title'] ?? '')); $seqOrder = (int)($request->getBody()['sequence_order'] ?? $_POST['sequence_order'] ?? 1);