Skip to content

fix: stop setup when saving SQLite configuration fails - #8

Open
ankushkhakale wants to merge 1 commit into
rottengrapes:mainfrom
ankushkhakale:fix/sqlite-setup-save-error
Open

ankushkhakale wants to merge 1 commit into
rottengrapes:mainfrom
ankushkhakale:fix/sqlite-setup-save-error

Conversation

@ankushkhakale

@ankushkhakale ankushkhakale commented Nov 3, 2026 •

Copy link
Copy Markdown

Closes #7.

When SQLite rejects a configuration write, setup.sh currently reports success and continues with the build, leaving the app on its previous settings.

This propagates the database failure and exits before the success messages, cache cleanup, build, or launch. It also adds a regression test using real SQLite and a short recovery note in the README.

The regression fails on the original script and passes with the fix. It checks that settings and the previous build cache survive the read-only failure, then verifies setup works after permissions are restored.

Before / After

Scenario: deliberately made the disposable database read-only (chmod 444 data/geovista.db), then reran bash setup.sh with a different URL/port and declined launch. SQLite rejected writes; the baseline hid the error. Recorded excerpts:
Before:

[OK] Configuration saved directly into SQLite database (data/geovista.db)!
SETUP COMPLETED SUCCESSFULLY!
EXIT=0

After:

SQLite configuration error: SQLITE_READONLY
[ERROR] Could not save configuration to data/geovista.db. Check database permissions and available disk space, then run setup again.
EXIT=1

Validation

  • npm test and npm run test:coverage: 7 passed, no skips.
  • Bash syntax, whitespace, and TypeScript checks passed.
  • Lint passed with 75 warnings and no errors.

Tested on Linux as a non-root user. The regression substitutes the build command; actual production build and startup behavior were checked separately.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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.

setup.sh reports success when SQLite configuration cannot be saved

2 participants