Skip to content

Fix/app packaging#388

Open
egalvis27 wants to merge 2 commits into
mainfrom
fix/app-packaging
Open

Fix/app packaging#388
egalvis27 wants to merge 2 commits into
mainfrom
fix/app-packaging

Conversation

@egalvis27

Copy link
Copy Markdown

What is Changed / Added


  • Packaging and bundling strategy was adjusted to treat only the native runtime dependency as external.
  • Build packaging rules were expanded to explicitly include native runtime modules and their transitive runtime helpers inside the final app artifact.
  • Authentication credential recovery was hardened:
    • Added a shared empty-credentials fallback helper.
    • Replaced failure behavior from throwing to graceful fallback when secure storage is unavailable or decryption fails.
    • Updated logging levels/messages to reflect controlled fallback behavior.
  • Database repository initialization was corrected to use entity-class repository resolution instead of string-based names.
  • Hydration API tests were refactored to remove network-dependent behavior:
    • Server startup is now mocked.
    • Socket lifecycle and idempotent shutdown behavior are now verified with deterministic unit-level mocks.
    • Debug middleware behavior is asserted directly through middleware invocation.
  • Main-process authentication tests were aligned with the new fallback contract and updated expected logs.

Why

  • Native module loading requires filesystem/runtime resolution patterns that break when fully bundled, so native dependencies must remain external while keeping pure JS dependencies bundled for stability and smaller integration risk.
  • Explicitly copying native runtime modules ensures they are always present in packaged builds, preventing runtime crashes caused by missing binary or helper modules.
  • Auth token decryption is a startup-critical path; failing closed into a logged-out state is safer and more resilient than throwing, because it avoids hard startup failures and preserves a recoverable user flow.
  • Logging changes distinguish expected degraded-mode behavior from fatal errors, reducing false-positive error noise and improving operational diagnostics.
  • Entity-based repository resolution avoids fragile string mapping issues and makes ORM metadata resolution more robust during runtime initialization.
  • Network-free unit tests are faster, less flaky, and deterministic in CI; mocking server internals validates the same behavior without relying on local ports/timing.
  • Updated tests lock in the new resilience contract so regressions (re-throwing decrypt errors, non-idempotent stop behavior, socket cleanup gaps) are detected early.

…tions

refactor: streamline native externals in webpack config
chore: enhance packaging for better-sqlite3 and bindings
test: improve getCredentials tests to handle safeStorage availability
@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