Skip to content

Settings → Block save after failed connection test - #162

Merged
revett merged 1 commit into
8thpark:mainfrom
snowyukitty:fix/block-save-after-failed-connection-test
Jul 29, 2026
Merged

revett merged 1 commit into
8thpark:mainfrom
snowyukitty:fix/block-save-after-failed-connection-test

Conversation

@snowyukitty

@snowyukitty snowyukitty commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #157

Problem

  • A dirty draft could still be saved while a connection test was running or after it had failed
  • Disabling only the button would not protect against a queued click reaching the persistence method
  • An older in-flight result could overwrite the unknown state of a draft edited while that test was running

Changes

  • Define one save-eligibility rule: the draft must be dirty and its connection state must be unknown or ok
  • Apply that rule to both the Save button and the persistence boundary
  • Test a snapshot of the draft and discard results whose generation or settings no longer match
  • Add table-driven and effect-level coverage for all four states, queued saves, and edit-during-flight races

Validation

  • npm run lint
  • npm run build
  • npm test (208 passed)
  • npm run test:integration (25 passed)
  • npm run check-versions
  • npm run audit (0 vulnerabilities)
  • Secretlint on all changed files
  • git diff --check

Greptile Summary

Adds a unified save-eligibility rule and stale connection-result protection.

  • Blocks settings persistence while a connection test is running or after it fails.
  • Snapshots tested settings and discards results that no longer match the current generation or draft.
  • Adds unit and effect-level coverage for save states, queued saves, and edit-during-test behavior.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified in the changed behavior.

The Save button and persistence boundary now enforce the same eligibility rule, while connection tests use immutable settings snapshots and generation checks before updating state.

Important Files Changed

Filename Overview
src/settings/settings.ts Introduces shared connection-state, save-eligibility, stale-result, and persistence helpers without an accepted defect.
src/settings/tab.ts Applies the shared save rule at both UI and persistence boundaries and prevents obsolete connection results from updating current state.
src/settings/settings.test.ts Adds table-driven and effect-level coverage for all connection states, queued saves, and stale test results.

Reviews (1): Last reviewed commit: "Settings → Block save after failed conne..." | Re-trigger Greptile

@revett

revett commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@snowyukitty Thanks for the contribution and welcome 🙏

Please star the project ⭐

Reviewing your PR now

@revett

revett commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@greptileai Review PR

@revett
revett merged commit 5527a5f into 8thpark:main Jul 29, 2026
10 checks passed
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.

Settings → Block save on failed connection test

2 participants