-
Notifications
You must be signed in to change notification settings - Fork 0
16 Notifications Presence and Background Lifecycle
Corresponding Specifications:
sys-arch/30-presence-availability-typing-read-receipts-ephemeral-state-architecture.md,sys-arch/31-notifications-push-background-delivery-lifecycle-architecture.md,sys-arch/ui-ux-13-notifications-background-incoming-call-architecture.md,sys-arch/ui-ux-14-presence-typing-receipts-status-architecture.md
Key Crates:crates/siar-ui-state,crates/siar-messaging
Unlike persistent chat messages that are stored in the database, typing indicators and active presence are ephemeral state events with strict, short-lived time-to-live (TTL) limits:
pub struct EphemeralPresenceEvent {
pub account_id: AccountId,
pub conversation_id: ConversationId,
pub presence_state: PresenceState, // Typing, Online, LeftConversation
pub ttl_ms: u32, // Typically 3,000 ms to 5,000 ms
pub timestamp: Timestamp,
}sequenceDiagram
actor Alice as Alice (Typing in Composer)
actor Bob as Bob (Viewing Conversation)
Alice->>Alice: User types keystroke in composer
Alice->>Alice: Debounce Timer (Emit 1 event per 3s max)
Alice->>Bob: Transmit EphemeralPresenceEvent(Typing, TTL=3s)
Bob->>Bob: Display "Alice is typing..." + Animated Dots
Bob->>Bob: Set Auto-Clear Timer (3.5s)
Note over Alice,Bob: If Alice stops typing, Bob's UI clears automatically
To prevent stalker surveillance and timing analysis:
- Mutual Contact Invariant: Presence indicators are only transmitted to contacts explicitly verified and saved in the user's address book.
- Stealth / Ghost Mode: Users can toggle "Stealth Mode" at any time. When enabled, the local node receives mesh traffic normally but emits zero presence or typing broadcasts.
-
Coarse Mesh Status: Nodes in mesh range show as
"Nearby on Mesh"rather than precise GPS coordinates or real-time IP addresses.
Keeping radios listening in the background while complying with aggressive OS battery management (Android Doze, iOS background app refresh) requires a multi-tier strategy:
[System State: Screen Off / Deep Doze]
|
v
+---------------------------------------------------------------+
| Android Persistent Foreground Service |
| - Holds partial WakeLock only during active mesh bursts |
| - Low-power BLE Extended Advertising (Scan cycle: 100ms/5s) |
| - Wi-Fi Direct socket listeners maintained via native epoll |
+-------------------------------+-------------------------------+
|
+----------------+----------------+
| (Internet Available) | (Pure Off-Grid Mesh)
v v
[UnifiedPush / WebPush Gateway] [Direct BLE / Mesh Radio Wake]
| |
+----------------+----------------+
|
v
[Local Notification Raised in OS]
When an incoming voice/video call signaling offer arrives:
- The native Rust engine triggers the Android
CallStylehigh-priority notification. - The phone screen illuminates with full-screen incoming call UI, ringtone, and vibration pattern even if the device was in deep sleep.
- If the user accepts, the audio DSP hardware immediately connects without cold-starting the full application.
SIAR — Survivable Identity & Autonomous Routing
Open Source Mesh & DTN Communications Platform | Dual Licensed under MIT / Apache-2.0 / Commercial
Documentation Index • GitHub Repository • System Specifications
- 04-Autonomous-Routing-and-Policy-Engine
- 05-Proximity-and-Hardware-Transports
- 06-Delay-Tolerant-Networking-and-Bundle-Forwarding
- 07-Battery-Aware-Scheduling-and-Emergency-Mesh
- 08-Offline-Event-Log-and-Outbox-Engine
- 09-Robust-Blob-Storage-and-Chunk-Transfers
- 10-Crash-Recovery-and-Data-Portability
- 11-Realtime-Audio-Video-Calling-Architecture
- 12-Cross-Platform-Client-Architecture
- 13-Messaging-Timeline-Composer-and-Inbox
- 14-Contacts-Groups-and-Security-Center
- 15-Nearby-Discovery-and-Out-of-Band-Pairing
- 16-Notifications-Presence-and-Background-Lifecycle
- 17-Local-Knowledge-Retrieval-and-Search
- 25-Design-System-Tokens-and-Responsive-Layouts
- 26-UI-UX-Performance-Testing-and-Quality-Gates
- 18-Protocol-Extensions-and-WASM-Plugins
- 19-Headless-Daemons-and-Embedded-Nodes
- 20-C-ABI-FFI-and-Native-Language-Bindings
- 21-Testing-Fuzzing-and-Network-Diagnostics
- 22-Getting-Started-and-Developer-Guide
- 23-Off-Grid-Survival-and-Field-Operations-Guide
- 24-System-Comparison-and-Benchmarking