Skip to content

fix(startup): Fix wizard response flow and first-run log noise#1076

Merged
leumor merged 2 commits intorelease/2from
bugfix/wizard-first-run-errors
Feb 22, 2026
Merged

fix(startup): Fix wizard response flow and first-run log noise#1076
leumor merged 2 commits intorelease/2from
bugfix/wizard-first-run-errors

Conversation

@leumor
Copy link
Collaborator

@leumor leumor commented Feb 22, 2026

Summary

  • Fix FirstTimeWizardNewToadlet POST flow to return immediately after redirect, preventing duplicate header writes (Already sent headers!).
  • Remove shared mutable password state from the toadlet and compute password-already-set state per request.
  • Update first-time wizard password save path to use changeMasterPassword("", newPassword, true) so it does not throw AlreadySetPasswordException when keys are already initialized.
  • Reduce first-run startup log noise by handling missing bookmarks.dat and missing uptime history files as normal fallback cases.
  • Update wizard unit test assertions for the corrected redirect-only success behavior.

How to test

  1. Run focused tests:
    • ./gradlew test --tests network.crypta.clients.http.FirstTimeWizardNewToadletTest --tests network.crypta.clients.http.bookmark.BookmarkManagerTest --tests network.crypta.node.UptimeEstimatorTest
  2. Run full suite:
    • ./gradlew test
  3. Manual sanity check (Flatpak first run):
    • Submit the first-time wizard form and verify no Already sent headers! error is logged.
    • Verify missing first-run bookmarks.dat and uptime files no longer emit misleading error-level startup logs.

Notes

  • Base branch for this PR is release/2 (per request).

Return immediately after wizard redirect to avoid double header sends.

Use changeMasterPassword in first-time wizard to avoid AlreadySetPasswordException.

Treat missing first-run bookmark/uptime files as normal fallback conditions.

Update wizard unit test assertions for redirect-only success path.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32829dac3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Load master keys from disk with oldPassword when master.keys exists but in-memory keys are null.

Preserve existing password-change flow and add regression test for the null-keys path.
@leumor
Copy link
Collaborator Author

leumor commented Feb 22, 2026

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
77.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@leumor leumor merged commit c9c4784 into release/2 Feb 22, 2026
3 of 4 checks passed
@leumor leumor deleted the bugfix/wizard-first-run-errors branch February 22, 2026 20:25
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