Commit Graph
7 Commits
Author SHA1 Message Date
Andrey Bocharnikov 711ed290d9 fix(messaging): don't crash on a queued hash ratchet message that isn't processed
processMessage legitimately returns (nil, nil) when a message is still
segmented-incomplete or gets re-queued because its hash ratchet key has
not arrived yet. processQueuedHashRatchetMessages dereferenced that nil
response (the shadowed r), crashing the whole app with SIGSEGV. Skip
such messages and leave them in the queue.
2026-08-14 13:12:49 +04:00
Jonathan Rainville b7b5f827a7 fix(sds): fix SDS stayed closed after coming back from offline
Reliability.Stop() destroyed the SDS reliability manager while Start() only
rebuilt the mvds datasync node, so the first offline->online transition (driven
by Core.connectionChanged) left SDS nil for the rest of the process and every
subsequent message — live or fetched from a store node — arrived still
SDS-wrapped, failed to decode at the application layer and surfaced as type
UNKNOWN. Stop() now tears down only the datasync node and preserves SDS, whose bloom filter and causal history are exactly the state needed to detect what was missed while offline; a new Close() releases it on shutdown, and Start()
rebuilds it if it is ever missing. Two related bugs are fixed alongside:
UnwrapPayloadFromSDS now returns ErrSDSManagerUnavailable when the manager is gone instead of silently passing the wrapped payload through (it still passes through, error-free, when a payload is simply not SDS-wrapped), and the
processor propagates that error so the envelope is retried rather than
confirmed as processed. sdsManager is stored in an atomic.Pointer, since the
hot path read it without holding the lock that Start/Stop write under.
2026-08-11 16:24:26 -04:00
Jonathan Rainville 40db5cc35a feat(sds): enable sds wrapping and fetching of retrieval hints
Fixes #7363

Enables the SDS wrapping flag.
Sets up the handler that wraps SDS messages with retrieval hints. Those hints are the envelope IDs of the messages that were sent and received
Sets up the unwrapping and fetching when there are missed messages detected.
Adds a new function that enables fetching per envelope ID instead than per topic.
2026-08-03 13:48:10 -04:00
Igor Sirotin 24d0132145 chore: fix numbered import names (#7416) 2026-04-16 13:22:54 +01:00
Igor Sirotin 63fe9e7227 feat: sds unwrapping (#7227)
* feat: Add SDS unwrap process for received messages (#7149)

* feat: enable sds for wrap message

* chore: add sds default flag

* feat: enable sds for public community message

* fix: always set community id

* feat: add message ID for public params

* chore: move sds to reliability

* chore: refactor flags

* chore: add unit test for sds

* chore: fix test

* chore: add test-single helper

* chore: update Makefile

Co-authored-by: Igor Sirotin <sirotin@status.im>

* chore: update logs

Co-authored-by: Igor Sirotin <sirotin@status.im>

* chore: refactor function name for init sds

* chore: merge upstream

* chore: refactor sds processor

* chore: move sds wrap logic to messaging sender.

* chore: refactor sds manager

* chore: disable sds wrap

* fix: disable Nim signal handler

---------

Co-authored-by: Igor Sirotin <sirotin@status.im>

* fix: cleanup sds manager

* feat: set sds logger

* chore: update sds-go-bindings

* test: named loggers

* test: TestSdsFileDescriptors

* chore: vendor hash

* feat: support updating nim-sds

* fix: TestSdsFileDescriptors skip comment

* chore: bump sds-go-bindings

* chore: bump nim-sds

* chore: vendor hash
2025-12-22 19:57:36 +00:00
Igor Sirotin 30935148c4 refactor: project layout (crypto, logutils, rpc, accounts-management) (#7226)
* refactor: internal/crypto

* refactor: internal/logutils

* chore: internal/rpc

* refactor: internal/accounts-management
2025-12-18 12:24:40 +00:00
Igor Sirotin 0fcf4ceb8e refactor: project layout (messaging) (#7224)
* refactor: pkg/messaging

* fix: address non-go changes
2025-12-17 19:40:40 +00:00