Skip to content

Commit cef5654

Browse files
committed
Update to pre-release version. Removed logging that was used for debugging. Added typing of files that the user sends with size restrictions.
1 parent 3eab058 commit cef5654

File tree

9 files changed

+520
-175
lines changed

9 files changed

+520
-175
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ open http://localhost:8000
254254

255255
## 🗺️ Development Roadmap
256256

257-
**Current:** v4.01.222 — PWA & File Transfer Edition ✅
257+
**Current:** v4.01.412 — PWA & File Transfer Edition ✅
258258

259259
* Progressive Web App installation
260260
* Secure P2P file transfer system
@@ -551,6 +551,6 @@ SecureBit.chat:
551551

552552
---
553553

554-
**Latest Release: v4.01.222** — PWA & Secure File Transfer
554+
**Latest Release: v4.01.412** — PWA & Secure File Transfer
555555

556556
</div>

SECURITY_DISCLAIMER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Security Disclaimer and Terms of Use
22

3-
## 🔒 SecureBit.chat Enhanced Security Edition v4.01.222
3+
## 🔒 SecureBit.chat Enhanced Security Edition v4.01.412
44

55
### Important Legal Notice
66

@@ -203,6 +203,6 @@ This software is created to:
203203
---
204204

205205
*Last Updated: 08.07.2025*
206-
*Version: Enhanced Security Edition v4.01.222*
206+
*Version: Enhanced Security Edition v4.01.412*
207207

208208
**USE AT YOUR OWN RISK AND RESPONSIBILITY**

index.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
icon: "fas fa-shield-halved",
162162
color: "orange",
163163
title: "12-Layer Military Security",
164-
description: "Revolutionary defense system with ECDH P-384 + AES-GCM 256 + ECDSA. Enhanced Security Edition v4.01.222 provides military-grade protection exceeding government standards."
164+
description: "Revolutionary defense system with ECDH P-384 + AES-GCM 256 + ECDSA. Enhanced Security Edition v4.01.412 provides military-grade protection exceeding government standards."
165165
},
166166
{
167167
icon: "fas fa-bolt",
@@ -511,7 +511,7 @@ <h3 className="text-3xl font-bold text-primary mb-3">
511511
Enhanced Security Edition Comparison
512512
</h3>
513513
<p className="text-secondary max-w-2xl mx-auto mb-4">
514-
SecureBit.chat v4.01.222 Enhanced Security Edition vs leading secure messengers
514+
SecureBit.chat v4.01.412 Enhanced Security Edition vs leading secure messengers
515515
</p>
516516
<div className="inline-flex items-center px-4 py-2 bg-yellow-500/10 border border-yellow-500/20 rounded-lg">
517517
<span className="text-yellow-400 mr-2">🏆</span>
@@ -657,7 +657,7 @@ <h3 className="text-3xl font-bold text-primary mb-3">
657657
<div className="p-6 bg-gradient-to-r from-orange-500/10 to-yellow-500/10 border border-orange-500/20 rounded-xl">
658658
<h4 className="text-xl font-bold text-orange-400 mb-4 flex items-center">
659659
<i className="fas fa-trophy mr-3" />
660-
SecureBit.chat v4.01.222 Enhanced Security Edition Summary
660+
SecureBit.chat v4.01.412 Enhanced Security Edition Summary
661661
</h4>
662662
<p className="text-secondary leading-relaxed text-lg mb-4">
663663
SecureBit.chat dominates in 11 out of 15 security categories, establishing itself as the most secure P2P messenger available.
@@ -3195,7 +3195,7 @@ <h3 key="title" className="text-2xl font-semibold text-primary mb-3">
31953195
const downloadMessage = React.createElement('div', {
31963196
className: 'flex items-center space-x-2'
31973197
}, [
3198-
React.createElement('span', { key: 'label' }, `📥 Файл получен: ${fileData.fileName} (${sizeMb} MB)`),
3198+
React.createElement('span', { key: 'label' }, `📥 File received: ${fileData.fileName} (${sizeMb} MB)`),
31993199
React.createElement('button', {
32003200
key: 'btn',
32013201
className: 'px-3 py-1 rounded bg-blue-600 hover:bg-blue-700 text-white text-xs',
@@ -3210,7 +3210,7 @@ <h3 key="title" className="text-2xl font-semibold text-primary mb-3">
32103210
setTimeout(() => fileData.revokeObjectURL(url), 15000);
32113211
} catch (e) {
32123212
console.error('Download failed:', e);
3213-
addMessageWithAutoScroll(`❌ Ошибка загрузки файла: ${String(e?.message || e)}`, 'system');
3213+
addMessageWithAutoScroll(`❌ File upload error: ${String(e?.message || e)}`, 'system');
32143214
}
32153215
}
32163216
}, 'Скачать')
@@ -3221,15 +3221,14 @@ <h3 key="title" className="text-2xl font-semibold text-primary mb-3">
32213221

32223222
// Error callback
32233223
(error) => {
3224-
// Более мягкая обработка ошибок файлового трансфера - не закрываем сессию
32253224
console.error('File transfer error:', error);
32263225

32273226
if (error.includes('Connection not ready')) {
3228-
addMessageWithAutoScroll(`⚠️ Ошибка передачи файла: соединение не готово. Попробуйте позже.`, 'system');
3227+
addMessageWithAutoScroll(`⚠️ File transfer error: connection not ready. Try again later.`, 'system');
32293228
} else if (error.includes('File too large')) {
3230-
addMessageWithAutoScroll(`⚠️ Файл слишком большой. Максимальный размер: 100 МБ`, 'system');
3229+
addMessageWithAutoScroll(`⚠️ File is too big. Maximum size: 100 MB`, 'system');
32313230
} else {
3232-
addMessageWithAutoScroll(`❌ Ошибка передачи файла: ${error}`, 'system');
3231+
addMessageWithAutoScroll(`❌ File transfer error: ${error}`, 'system');
32333232
}
32343233
}
32353234
);

src/components/ui/FileTransfer.jsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ const FileTransferComponent = ({ webrtcManager, isConnected }) => {
2525
webrtcManager.setFileTransferCallbacks(
2626
// Progress callback - ТОЛЬКО обновляем UI, НЕ отправляем в чат
2727
(progress) => {
28-
console.log(`📁 UI Progress: ${progress.fileName}: ${progress.progress.toFixed(1)}% (${progress.status})`);
29-
3028
// Обновляем только локальное состояние
3129
const currentTransfers = webrtcManager.getFileTransfers();
3230
setTransfers(currentTransfers);
@@ -36,7 +34,6 @@ const FileTransferComponent = ({ webrtcManager, isConnected }) => {
3634

3735
// File received callback - добавляем кнопку скачивания в UI
3836
(fileData) => {
39-
console.log(`📥 File received in UI: ${fileData.fileName}`);
4037
// Добавляем в список готовых к скачиванию
4138
setReadyFiles(prev => {
4239
// избегаем дублей по fileId
@@ -59,7 +56,6 @@ const FileTransferComponent = ({ webrtcManager, isConnected }) => {
5956

6057
// Error callback
6158
(error) => {
62-
console.error('File transfer error in UI:', error);
6359
const currentTransfers = webrtcManager.getFileTransfers();
6460
setTransfers(currentTransfers);
6561

@@ -83,19 +79,27 @@ const FileTransferComponent = ({ webrtcManager, isConnected }) => {
8379

8480
for (const file of files) {
8581
try {
86-
console.log(`🚀 Starting file upload from UI: ${file.name}`);
82+
// КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: Валидация файла перед отправкой
83+
const validation = webrtcManager.validateFile(file);
84+
if (!validation.isValid) {
85+
const errorMessage = validation.errors.join('. ');
86+
alert(`Файл ${file.name} не может быть отправлен: ${errorMessage}`);
87+
continue;
88+
}
89+
8790
await webrtcManager.sendFile(file);
8891
} catch (error) {
8992
// Более мягкая обработка ошибок - не закрываем сессию
90-
console.error(`Failed to send ${file.name}:`, error);
9193

9294
// Показываем пользователю ошибку, но не закрываем соединение
9395
if (error.message.includes('Connection not ready')) {
9496
alert(`Файл ${file.name} не может быть отправлен сейчас. Проверьте соединение и попробуйте снова.`);
95-
} else if (error.message.includes('File too large')) {
96-
alert(`Файл ${file.name} слишком большой. Максимальный размер: 100 MB`);
97+
} else if (error.message.includes('File too large') || error.message.includes('exceeds maximum')) {
98+
alert(`Файл ${file.name} слишком большой: ${error.message}`);
9799
} else if (error.message.includes('Maximum concurrent transfers')) {
98100
alert(`Достигнут лимит одновременных передач. Дождитесь завершения текущих передач.`);
101+
} else if (error.message.includes('File type not allowed')) {
102+
alert(`Тип файла ${file.name} не поддерживается: ${error.message}`);
99103
} else {
100104
alert(`Ошибка отправки файла ${file.name}: ${error.message}`);
101105
}

src/components/ui/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ const EnhancedMinimalHeader = ({
497497
React.createElement('p', {
498498
key: 'subtitle',
499499
className: 'text-xs sm:text-sm text-muted hidden sm:block'
500-
}, 'End-to-end freedom. v4.01.222')
500+
}, 'End-to-end freedom. v4.01.412')
501501
])
502502
]),
503503

0 commit comments

Comments
 (0)