Skip to content

Harden release 1.0 readiness - #231

Open
svensieber wants to merge 14 commits into
EXXETA:rustfrom
svensieber:release/1.0-hardening-rust
Open

Harden release 1.0 readiness#231
svensieber wants to merge 14 commits into
EXXETA:rustfrom
svensieber:release/1.0-hardening-rust

Conversation

@svensieber

@svensieber svensieber commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

This branch hardens the Rust port for a 1.0 release candidate. It focuses on data safety, runtime liveness, scripting correctness, release packaging, and persistence behavior.

Migration and storage safety

  • Make legacy migration secret handling transactional: secrets are not written during preview/unlock; writes happen during apply and are rolled back on apply failure.
  • Wire migration backup restore through the app/runtime/persistence path so restore actions call the migration applier rollback and report completion/failure.
  • Allow recovery of interrupted migrations when a backup marker has no state fingerprint but the backup manifest is valid.
  • Harden persistent JSON writes with temp-file + replace/rename behavior for config, history, file-backed secrets, migration safety files, release metadata, and checksum output.
  • Add file-backed encrypted secret-store support and tests for batching, wrong-password handling, and legacy fixture compatibility.
  • Keep connection config and secret updates consistent by snapshotting affected secret values and restoring them if config persistence fails.

MQTT runtime and app shutdown

  • Add timeout-bounded MQTT operations so publish, subscribe, unsubscribe, and disconnect cannot block the service loop indefinitely.
  • Add explicit async MQTT service shutdown; app drop now performs graceful shutdown and task awaiting, with abort only as a fallback.
  • Let MQTT v3/v5 sessions flush DISCONNECT before aborting event-loop tasks.
  • Preserve operation failure reporting as normal MQTT errors when ACK waits time out.
  • Add regression coverage for lifecycle and fake-broker packet behavior.

UI/runtime liveness and retention

  • Wake egui on background runtime events and add a bounded repaint fallback while background workers are active.
  • Cap retained incoming MQTT messages per workbench and publish-history rows to avoid unbounded UI memory growth.
  • Keep subscription message counts consistent when retained messages are pruned.
  • Add runtime/model tests for message retention and publish-history limits.

JavaScript scripting runtime

  • Make the promise MQTT client execute real host MQTT operations when awaited.
  • Keep awaited host MQTT promise failures typed without poisoning later guest-thrown errors.
  • Replace guest-visible host-error marker parsing with host-side JS Error identity tracking so copied messages/properties cannot spoof host errors.
  • Ensure host-side registered JS Error objects are cleared on every QuickJS context exit path before runtime teardown.
  • Add QuickJS memory, stack, GC, deadline, and cancellation limits so scripts cannot run unbounded.
  • Add tests for promise execution, handled rejection behavior, spoof resistance, cancellation, and deadline enforcement.

Plugin and release packaging

  • Generate and upload plugin release artifacts in the release workflow.
  • Validate plugin IDs as safe single path components before staging or filesystem writes.
  • Harden plugin archive/repository generation paths and checksum validation.
  • Strengthen package smoke checks so expected platform artifacts, per-artifact .sha256 files, and SHA256SUMS are validated and stale sidecars are rejected.
  • Split package installer/checksum/metadata helpers for clearer release tooling.

Rust port integration cleanup

  • Add/update Rust-port migration fixtures and storage conversion paths.
  • Add transfer connection import/export model paths.
  • Add update-check integration and related app/runtime wiring.
  • Add clippy.toml for workspace lint configuration.

Verification

  • cargo test -p correo-scripting --test runtime
  • cargo test --workspace

Latest local verification before PR update: workspace tests passed with 291 tests across 65 suites and 7 ignored tests.

Remaining release gate

Before final 1.0, run real OS secret-store smokes on Windows, macOS, and Linux: create a connection with a secret, restart the app, and verify the secret persists and is usable.

@svensieber
svensieber force-pushed the release/1.0-hardening-rust branch from 3b48075 to f2dae1d Compare July 7, 2026 11:49
Sven Sieber added 7 commits July 7, 2026 14:17
…-rust

# Conflicts:
#	crates/correo-core/src/bootstrap.rs
#	crates/correo-core/src/mqtt/service.rs
#	crates/correo-core/src/mqtt/tests.rs
#	crates/correo-core/src/runtime.rs
#	crates/correo-core/src/runtime/plugin_tests.rs
#	crates/correo-core/src/settings_persistence.rs
#	crates/correo-storage/src/current/config.rs
#	crates/correo-storage/tests/config_store.rs
@svensieber
svensieber force-pushed the release/1.0-hardening-rust branch from c675085 to f087d87 Compare July 8, 2026 07:09
@svensieber
svensieber force-pushed the release/1.0-hardening-rust branch from f087d87 to c6e30b6 Compare July 8, 2026 07:14
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant