evgeny
7f901c01e1
etcp: переупорядочить close + защита state==2 во всех API-точках; topo: правильная очистка group nodes и registry; chat/member: новый модуль member_sync; chatgui: обновления транспорта и UI
2 months ago
evgeny
ca176e1f24
encrypt overhead fix (33→36, noencrypt_len), mtu default 1280, connmonitor window, total_decrypted for TCP, check.sh
2 months ago
evgeny
38c9f229bc
stcp: ed25519 pubkey exchange in handshake, fix instance destroy segfault, fix chat_tcp_test
...
- u_async.c: process immediate_queue BEFORE epoll_wait in uasync_poll
- stcp_link.c: defensive NULL etcp_conn/etcp_link in stcp_link_close
- utun_instance.c: move stcp_server_list_destroy_all to Phase J (before ETCP),
add deferred drain in both Phase J and L
- stcp.h/c: STCP_HS_ENC_CLIENT 6→38, STCP_HS_ENC_SERVER 7→39,
exchange ed25519_pubkey in both handshake directions
- etcp_connections.c: copy peer_ed25519 from STCP to ETCP_CONN in
etcp_link_enter_ready_tcp; guard link->etcp in tcp_link_close_cb
- chat_sync.c: fix lk->conn NULL dereference for TCP links
- test_stcp.c: update stcp_server_create/stcp_client_connect callsites
- tools/chat_tcp_test: change transport udp→tcp
2 months ago
evgeny
d773f1724a
refactor: STCP connections as ETCP links (is_tcp)
...
- Add is_tcp, tcp_link, tcp_reconnect_* fields to ETCP_LINK
- Remove transport_link from ETCP_CONN, add tcp_link_count
- stcp_link: replace embedded etcp_conn with pointer; add etcp_link backpointer
- stcp_link: link_rx_cb routes ETCP data to etcp_conn_input
- stcp_link: call on_close_cb in close
- New TCP functions: etcp_link_enter_ready_tcp, etcp_tcp_link_start_connect,
etcp_tcp_link_start_reconnect, tcp_link_close_cb, etcp_tcp_send
- etcp_link_new: handle NULL conn for TCP links; skip enter_init for TCP
- etcp_link_close: close stcp_link for TCP
- etcp_encrypt_send: redirect TCP to etcp_tcp_send (skips AES-CCM)
- tcp_server_on_link: create ETCP_LINK(is_tcp=1) + enter_ready_tcp
- etcp_connect: TCP addrs -> etcp_tcp_link_start_connect
- Remove ctx->tcp_link/tcp_ready
- test_stcp_traffic: find stcp_link via links->is_tcp instead of transport_link
- 66/68 tests pass; 2 STCP tests expected to fail (integration not complete)
2 months ago
evgeny
5feeb2c169
chatgui: clean up log — remove spam, move messages to proper categories
...
A-B: Remove gui_bridge_post_uasync_fn log, MainWindow::onMessageReceived, InputBar send text
B1: Move lifecycle messages to GENERAL (utun_node, main, mainwindow, animtimer, sound_manager, messagelist, db_manager)
B2: Move chat events to CHAT_SYNC (MSG_RECEIVED, CHANNEL_UPDATED, CHANNEL_PEERS_ONLINE, DB_READY)
B3: Move peer/connect events to MEMBER_SYNC (CONNECT_RESULT, NEW_PEER, AUTO_CONNECT, NODE_CHANGED)
C: Lower level of C-side spam (recalc, send OK, PUSH ACK, connect_channel) INFO->DEBUG
D: Fix duplicate PUSH log line in db_sync.c
E: Add debounce to CHANNEL_PEERS_ONLINE — log only on change
Misc: Remove sort=0 from ChannelList::loadChannels, improve DB_READY message
2 months ago
evgeny
712d1b53df
1
2 months ago
evgeny
c2191aad3b
chat: user-friendly INFO logs for invite/connect flow
...
- chat_sync.c: invite entry, JOINED/TIMEOUT messages
- conn_mgr_core.c: invite start (addrs+udp+tcp), NCD UP/DOWN/TIMEOUT,
TCP connect/ready/close, membership check send/receive/confirm/deny,
overall timeout
- node_conn_direct.c: NCD event names instead of numbers
2 months ago
evgeny
51d6c782ac
voice playback: miniaudio cursor ground truth + EMA smooth decay
...
- SoundManager: add currentPcmCursor()/isCurrentPcmPlaying() via ma_sound_get_cursor_in_pcm_frames / ma_sound_is_playing
- messagedelegate: replace wall-clock position tracking with real miniaudio cursor, remove 200ms hardcoded delay
- messagedelegate: end-of-playback detection via isCurrentPcmPlaying() instead of wall-clock comparison (was killing audio ~200ms early)
- messagedelegate: EMA smoothing of displayFrac/displayElapsed (0.15 factor, 16ms timer)
- messagedelegate: timer continues after audio stops to animate EMA decay to 0 (not mouse-move dependent)
- media_delivery: download progress callback, Ed25519 sig verify, author fallback, content hash check
- conn_mgr: already-connected returns OK with callback instead of error
- chatgui: voice download-pending auto-play, file download progress bar, media bar colors
2 months ago
evgeny
70797f921e
feature: media auto-download + manual download + UI download state indication (Android + desktop)
...
C-layer:
- chat_event.h: CHAT_EVT_ATTACHMENT_DOWNLOADED (14)
- chat_msg.c: fixed md_auto_download (non-NULL done_cb, correct media_base from db_path, use chat_setting for autoload checks)
- chat_msg.c: added chat_core_attachment_download + trampoline for manual download
- chat_core.h: exported attachment_dl_req + trampoline
Android (Kotlin + JNI):
- Message: downloadState field (parse from localAttrs)
- ChatRepository: parse localAttrs for download state
- NativeLib: attachmentDownload() JNI
- MessageBubble: FileBubble with download status icon + tap-to-download
- ChatViewModel: downloadAttachment() + CHAT_EVT_ATTACHMENT_DOWNLOADED handler
- ChatScreen: wire onDownloadFile handler
- android_jni_bridge: utun_bridge_attachment_download + JNI + localAttrs in JSON
Desktop (Qt/C++):
- messagedelegate.h: MsgFileDownloadStateRole, MsgChannelIdRole
- messagelist.cpp: parse localAttrs for file download state
- messagedelegate.cpp: FileBubble with download icon/text + click handler via chat_core_attachment_download_trampoline
- gui_bridge.h: GUI_EVT_ATTACHMENT_DOWNLOADED (14) + callback typedef
- gui_bridge_impl.cpp: event dispatch + setter
- mainwindow.cpp: callback registration -> refresh message list
2 months ago
Evgeny
6ef21613c8
chatgui: pass author node_id in MSG_RECEIVED event, skip sound for own messages
...
Add author_node_id:8 to GUI_EVT_MSG_RECEIVED data format.
Callback now includes uint64_t author parameter.
SoundManager::play('msg_incoming') only when author != myNodeId.
2 months ago
Evgeny
7a5df3e196
etcp: add node_changed callback chain + chatgui subscription
...
- etcp.h: add node_changed_cbks field to ETCP_CONN
- etcp_api.h/c: add etcp_conn_node_changed() + add/remove_node_changed_cbk
- etcp_connections.c: fire node_changed callbacks on pubkey mismatch
(with DEBUG_WARN(GENERAL) logging source addr, peer_id, old/new pubkey)
- etcp.c: cleanup node_changed_cbks on connection close
- chat_conn_mgr.c: subscribe to node_changed — clear DB addresses,
reset in-memory cache, close connections (deferred for current conn),
post GUI_EVT_NODE_CHANGED
- gui_bridge.h: GUI_EVT_NODE_CHANGED=11
- gui_bridge_impl.cpp: handle GUI_EVT_NODE_CHANGED
2 months ago
Evgeny
0e0ad9316a
fix race condition: DB_READY lost when utun thread starts before gui_bridge_init
...
- mainwindow.cpp: swap setupMessaging() before setupNode() so g_receiver is created first
- gui_bridge_impl.cpp: add DEBUG_WARN when gui_bridge_post drops event due to NULL g_receiver
3 months ago
Evgeny
960cde3eda
chatgui: add Status page in settings (NTP + connections status)
3 months ago
Evgeny
5b88d58dae
fix: demote spam auto_connect logs to DEBUG_DEBUG
...
Remain at INFO: attempt + result FAIL. Demoted to DEBUG: TIMEOUT,
CANCELLED, GC closing, flight launched, AUTO_CONNECT in_progress.
3 months ago
Evgeny
371208d489
chatgui: выпилить все записи в БД из GUI потока (DbManager)
...
- DbManager теперь read-only, получает sqlite3* handle через setDb()
- chat_core — единственный владелец БД (SQLITE_OPEN_FULLMUTEX + WAL)
- initTables/seedStubData/createChannel/insertMessage/setUiState удалены из DbManager
- seed 5 stub-аккаунтов перенесён в chat_core_init()
- GUI_EVT_DB_READY — уведомление о готовности БД
- setUiState заменён на QSettings
- каналы загружаются по DB_READY коллбэку
- убран двойной sqlite3_open (один файл, один хендл)
3 months ago
Evgeny
dccf54b30b
auto-connect + GUI per-channel indicators
...
- chat_core_connect_auto: direct ETCP connect from SQLite (no BGP)
- auto_connect: parallel connect to peers with 3s timeout, retry 10s
- RTT saved to node_addresses on disconnect
- vertical status bar + circle badge with online count per channel
- ChannelListView prevents deselection
3 months ago
Evgeny
d70cdbb040
chatgui: preserve active channel selection on reload, members sync, profile settings, member list model
3 months ago
Evgeny
85a91a1320
chatgui: invite link connect flow + GUI_ERROR always-on diagnostics
...
- debug_ui.h: remove NDEBUG guard so GUI_ERROR works in Release builds
- invite_link.h/cpp: add error field to InviteData with specific failure reason
- joindialog: show exact decode error in QLabel instead of generic message
- chat_sync: implement invite connect flow (CHANNEL_INFO_REQ/RESP, JOIN, WELCOME)
- topo_node_sqlite: node/address table init and lookup
- utun_node: getInviteAddresses fallback from ETCP sockets
- minor fixes in mainwindow, chat_core, gui_bridge
3 months ago
Evgeny
de7841f33a
chatgui: create group, unified logging, fix uasync_post epoll bug
...
- Add CreateGroupDialog with group name input
- Generate X25519+Ed25519 keypairs, random uint64 channel_id,
Ed25519 signature, write to DB via uasync thread
- chat_core_create_channel(): create msg table, topo_node_sqlite_channel_put()
- GUI_EVT_CHANNEL_UPDATED notification to reload channel list
- Per-category debug config: debug_level= + debug_categories= in [gui]
- Unified logging via debug_config: all threads write to same file/console
- debug_enable_console(1) to mirror file output to stderr
- DEBUG_LEVEL_DISABLED=-1: truly disable category, NONE=0 fallback to global
- Fix uasync_post under epoll: process_posted_tasks was never called
- Fix MainWindow constructor parameter ordering (dbPath vs debugFile)
- debug_ui.h: append mode ('a' instead of 'w')
3 months ago
Evgeny
62954ca0a9
chatgui: replace MsgClient/ChatPropagator/crypto with chat_core, update DB/messaging/layout
3 months ago
jeka
9dafb4c31e
gui update db and connection
3 months ago
Evgeny
19a4505a03
chat_sync: новый протокол синхронизации чата вместо ChatPropagator
...
- gui_bridge.h/cpp — кросс-поточные асинхронные коллбэки uasync↔GUI
- chat_sync.h/c — протокол синхронизации (INIT_SYNC/RESP, SEND_DATA, PUSH/ACK, SYNC_DONE)
- DbManager полностью переписан: per-channel таблицы msg_<ch> + peers_<ch>,
4 ключа в channels, signature, protocol/rtt в node_addresses, sync-методы
- ChatPropagator удалён, заменён на chat_sync
- db_sync_stub.c — заглушки для сборки chatgui без LMDB-версии db_sync
- db_schema.md актуализирован под новую схему
3 months ago