Backend#
Java 25 / Spring Boot 4 separates HTTP handling from business rules in the core flows. This refactor does not replace the E2EE protocol or destructively migrate the database.
| Responsibility | Components |
|---|---|
| Authentication HTTP | AuthenticationApi, MfaApi and RememberedMfaApi |
| Authentication rules | AuthenticationService, Identity, Mfa and RememberedMfaService |
| People, channels, messages and calls | PeopleApi, ChannelApi, MessageApi and CallTokenApi delegate to their services |
| Shared channel authorization | ChannelAccess replaces dependencies on the old central controller |
| Message persistence | MessageRepository; MessageService retains rules and transaction boundaries |
| Conversation reads | ChannelReadRepository batches participant names for direct/group chats |
| Administrative HTTP | WorkspaceAdministrationApi, InstanceAdministrationApi, WorkspaceConnectionApi and administration/api/AdminCatalogApi |
| Catalog authorization | administration/application/AdminCatalogService validates scope before reads |
| Account directory | Spring Data JDBC AccountDirectoryRepository and a credential-free AccountRecord projection |
| Complex catalog reads | administration/repository/AdminCatalogRepository uses explicit parameterized SQL |
| Input contracts | ChatRequests and AdministrationRequests with controller validation |
Spring Data JDBC is used for the administrative account directory. Complex SQL, locking and transaction-sensitive operations continue to use explicit JDBC. There is no JPA/Hibernate or automatic relationship fetching. Existing databases/volumes remain valid. New core modules use application services rather than treating controllers as shared dependencies.
Java formatting is reproducible: mvn fmt:format applies it; mvn fmt:check test verifies formatting and tests. Public endpoint export scans subpackages and expands administrative route alternatives.
Query changes#
- Channel lists batch participant names instead of querying each direct/group conversation. Presence remains batched.
- Message delivery reuses the persisted message when invoking webhooks, notifications and building the response.
- Identity/session reads include factor state while retaining revocation and federation checks. Remembered trust continues to validate effective policy on use.
- The notification inbox reads global preferences once and channel preferences in a batch, preserving mute and Do not disturb behavior.
- The portal uses thirty-row pages for accounts, workspaces, members, audit and connections, server search and cursors bound to area/workspace/query. One extra row detects whether another page exists without a mandatory total count.
- Additive indexes support audit paging and session-activity aggregation.
No production-load benchmark was performed. Fewer per-item queries and bounded pages are structural improvements; latency/capacity depend on data, execution plans, networking and hardware. Substring searches can still scan rows; there is no full-text/trigram index in this release. Pages are not immutable snapshots during concurrent changes.
Flutter application#
lib/screens/workspace.dart coordinates session, workspace, keys and lifecycle. Responsibility-specific library parts live in lib/features/workspace: navigation, calls, composing/attachments and message/deletion operations. They preserve private state and drafts without creating another key store or global call monitor.
lib/screens/admin.dart coordinates navigation/scope. Actions/views, a remote-page controller, searchable workspace picker and MFA-policy form live in lib/features/admin. The page controller cancels debounce on disposal, discards stale replies, deduplicates IDs and fetches further pages only on request.
lib/features/security groups factor confirmation, enrollment/recovery, required-enrollment gating and remembered-device storage. lib/features/stickers handles image preparation/cropping/export. Decoding/resizing uses compute off the UI isolate where isolates are supported; web retains browser execution limits.
The sticker editor accepts app-decodable images, including JPEG and BMP as well as PNG/WebP/GIF. Keep the entire image with transparent padding, or position/resize an optional square crop. Output is encrypted-attachment PNG at 512 × 512. Input is limited to 20 MB/16 megapixels for memory control. Unsupported formats, including HEIC where no decoder exists, must first be converted. Animated images use the first frame.
Verification and operation#
Run flutter analyze and flutter test in the app repository and mvn fmt:check test in the backend. Tests use synthetic accounts, databases, devices and images. Independent builds do not require sibling checkouts. Documentation remains locally generated for installation-owner hosting.
Library references: Spring Data JDBC queries and fmt-maven-plugin. These tools do not replace authorization review or deployment load testing.
Database migrations with Flyway#
Spring Boot runs Flyway before making the backend available. SQL migrations live in src/main/resources/db/migration: V1__initial_schema.sql creates/reconciles the initial schema and V3__remembered_mfa_devices.sql adds remembered MFA devices. Java migration one.sintonia.migration.V2__Normalize_channel_names incorporates legacy channel-name normalization. spring.sql.init.mode=never disables recurring schema.sql execution.
Empty databases receive every version. A pre-Flyway installation without flyway_schema_history is adopted only if its tables and structural fingerprint match Sintonia and there are no unknown tables in the schema. The backend records baseline 0, then runs all versions, currently V1–V11. The legacy marker prevents repeated channel renaming. Unrecognized databases are rejected; do not enable automatic baseline to bypass this check. Use a dedicated application schema.
Back up PostgreSQL, uploads and operational keys before upgrading. Rehearse on an isolated copy with no outgoing mail/webhook jobs. Check versions/success in flyway_schema_history and backend health after startup. Never edit applied migrations: add V4, V5, etc. Flyway validates SQL file checksums; keep the Java migration immutable too. clean is disabled. Do not use repair to hide mismatches. Rolling back the JAR does not roll back the database: plan a corrective migration or restore a tested backup.
Personal stickers belong to an encrypted account collection on the home installation and synchronize between authorized devices. Browse Recent, Favorites, packs and search. Long-press or right-click an item to favorite, rename, move to a pack or remove it; create new images with optional manual cropping. The star on a received sticker saves it as a favorite. Each collection allows 100 images and 20 MiB of ciphertext, with PNG images up to 2 MiB/512 × 512; identical images are deduplicated. Encrypted thumbnails are paginated in groups of 50; full images download on demand. The previous local collection is imported without deleting pending items before server confirmation. Network failures show pending synchronization. QR authorization shares the key automatically; the encrypted backup can recover it. Email-only account recovery without history starts a new collection because it cannot recover lost keys. Every send still creates an encrypted attachment for the destination conversation. See stickers.
V4 adds message/thread cursor indexes. V5 stores only server-managed public-channel keys, encrypted under the operational key. This does not enable federation or corporate custody. The client prioritizes the active conversation with parallel requests, synchronizes other channels in batches of three, and uses a 30-second fallback refresh with background key distribution limited to one cycle per minute. Presence events no longer reload the whole catalog.
Collaboration, discovery and custody modules#
Packages messaging, people, meetings, custody, audit and security separate changed workflows into api (HTTP/validation/headers), application (authorization, transactions, rules and cursors) and repository (bounded parameterized persistence).
Spring Data JDBC supplies typed message-catalog, people-directory, audit-event and authorized-session projections. Aggregation, locks and exports use explicit JDBC repositories without automatic relationship loading or per-result queries. Messaging, people and privacy/custody commands were extracted from old HTTP classes. Legacy meeting, encryption and federation components remain: this is an incremental refactor, not a claim that the entire backend was rewritten.
Discovery requires a local session bound to a trusted device. Queries enforce channel membership, active authorized workspace, logical deletion and recovered-history epochs. Catalog, unread, custody and audit cursors validate scope and stable order. Server authorization never depends on hiding UI actions.
V17 adds meeting rings, conversation read receipts and history indexes. Receipts advance monotonically under account lock. Existing individually read notifications remain authoritative; no contiguous watermark is inferred from them. Ring/receipt SSE is emitted after commit. Administrative audit is not WORM storage and has no configurable retention in this version.
Flutter features/authentication owns login/verification/session transitions, with shared brand/opening widgets. features/discovery owns local-search/unread controllers and directory/navigation. features/custody separates controller, layout, overview and guided forms; features/audit separates controller, filters and labels. features/media owns attachment playback. Workspace orchestration remains split into responsibility-specific Dart parts with one key/call-monitor lifecycle.
Scoped API clients follow their owning session while preserving workspace context: account changes reject old requests/responses and token renewal does not retain stale copies. Controllers also check revision/disposal. Search never creates a persistent decrypted-text index. See discovery and audit.
Message editor continuity#
Sending uses a text snapshot while leaving the editor writable for the next draft. Acknowledgement clears the text only if it still matches the sent snapshot. The next send becomes available after the POST, independently of history/profile refreshes. Failures retain the draft and allow retrying the same message identifier.
The editor keeps its identity and focus across attachment/upload states. Opening the file picker suspends editing; returning to the current conversation restores focus, including cancellation. JSON requests have a fifteen-second deadline for the complete response and individual cancellation on timeout, without restarting the HTTP client or clearing local data.
Paste images into chat#
Focus the editor and use Ctrl+V, or ⌘+V on macOS, to attach a copied image. It is added to the draft: write a caption, remove the attachment or confirm sending. Existing text is preserved. Browsers accept multiple images when the paste event provides them. The normal attachment encryption, upload limits and quotas apply.
Ordinary text paste remains available. Copying an image address pastes its link; the application does not fetch clipboard URLs or HTML to obtain images. Clipboard contents are not monitored in the background. Installed applications must be updated to register the new native component; reloading an older build does not install the plugin.
Upload responsiveness#
The client runs one binary PUT at a time per client instance (browser tab or app). JSON reads, message sends, heartbeats and downloads do not join that queue. Account, session and workspace are rechecked before a queued upload starts; a stale session cannot send a previous account's file. Failures release the lane. This queue does not reserve bandwidth or impose an Mbps cap.
On the web, the browser decodes and resizes photos before Dart JPEG processing, limiting that step to a poster of up to 160 pixels. Sintonia MKV posters read only the first video frame without assembling PCM audio or traversing the recording. Poster scanning has bounded element/offset limits; lack of a valid poster does not prevent upload. Full playback retains its previous validation and size limits. The backend already streams incoming data before opening its quota/registration transaction; that policy is unchanged.
These changes reduce upload concurrency and UI processing. A single upload can still saturate a slow uplink. The part-based flow below yields to interactive requests; it is not an Mbps shaper or persistent client restart recovery.
Interactive requests between upload parts#
For ciphertext attachments of at least 1 MiB, clients discover public uploadProtocol: 2. Compatible servers receive parts initially sized at 128 KiB and adapted between 32 KiB and 1 MiB toward 500 ms per exchange. A 40 ms pause and up to two seconds waiting for pending JSON requests give chat reads/sends a chance to complete between parts. This is an adaptive target, not a latency guarantee or bandwidth reservation. Request overhead can increase total transfer time.
AES-GCM ciphertext and attachment format remain unchanged. Every operation checks the account, channel membership and workspace. Part reception does not hold a database transaction. Offsets and identical retries are checked; normal quotas and attachment registration apply only at finalization. Parts are not visible chat attachments. Accountless guests remain scoped to their meeting conversation.
Encrypted staging files use .transfers under the attachment directory: two per user, a default global 512 MiB reservation (sintonia.upload.staging-limit-bytes), and a disk-space margin. Periodic cleanup removes only transfers inactive for over an hour. Local originals remain intact. The client does not persist automatic restart recovery; the protocol can resume the same ciphertext/ID by repeating initiation and receiving the stored offset. Transfer locks are local: multiple-backend installations must route all transfer operations to a single upload backend with the attachment volume. Distributed staging coordination is not implemented. Update backend and client together; older backends without the capability keep using the legacy PUT. No migration is required.
RustFS storage update#
Compose deployments use a separate private RustFS service for attachments, media/voice, stickers, profile photos and worker SREC archives. On-device originals remain local; published copies use attachment upload. API authorization remains in place, with references in PostgreSQL. Backend upload staging/locks and events still require single-writer operation. Shared storage alone does not enable multiple backend replicas. See RustFS.