Skip to content

fix: background_tasks: settings form accepts unbounded numeric values and gives no save feedback - #279

Open
antosubash wants to merge 5 commits into
mainfrom
pi/issue-270-background-tasks-settings-form-accepts-u
Open

fix: background_tasks: settings form accepts unbounded numeric values and gives no save feedback#279
antosubash wants to merge 5 commits into
mainfrom
pi/issue-270-background-tasks-settings-form-accepts-u

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Closes #270

Headless Pi worker

This is a draft pull request created from an issue carrying the approval label.
It is never merged automatically and requires human review.

Agent summary

Implementation summary

  • Added bounds: retention_days 1–3650 and max_retries 0–100.
  • Invalid values now return 422 without persistence.
  • Added “Settings saved” success toast.
  • Added pre-submit invite email validation, warning, and disabled submission for invalid addresses.
  • Added Python and React regression tests.

Changed areas

  • Background task settings schema and documentation.
  • Settings module save feedback.
  • Users invite form validation.
  • Vitest/module test configuration and package metadata.

Verification

  • uv run pytest ... — 251 passed.
  • npm test -- --run — 110 passed.
  • make gen-pages && make lint — passed.
  • make doctor — 0 errors; one pre-existing SM003 AuditLog warning.
  • git diff --check — passed.

Visual evidence: none; UI behavior covered by component tests.

Risks/blockers: none known.

Local visual evidence

When requested, screenshots, traces, videos, and GIFs are stored only under the worker worktree's ignored
.qa/issues/270/ directory. GitHub CLI cannot attach those files; inspect them on the worker host
or attach selected evidence manually.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5aba5f0
Status: ✅  Deploy successful!
Preview URL: https://91fd26cf.simple-module-python.pages.dev
Branch Preview URL: https://pi-issue-270-background-task.simple-module-python.pages.dev

View logs

@antosubash

Copy link
Copy Markdown
Owner Author

/pi add visual confirmation

@antosubash

Copy link
Copy Markdown
Owner Author

✅ Feedback processed with no tracked code changes.

  • Feedback: Add visual confirmation.
  • Response: Prepared an isolated QA app/database, but screenshot capture was blocked. Playwright Chrome cannot create its required socket in the sandbox; Firefox installation was denied by the network allowlist. No tracked changes were needed.
  • Checks: Python regression tests: 17 passed. Vitest UI tests: 7 passed.
  • Evidence: .qa/reports/issue-270-review-visual.md; server logs at .qa/issue-270-{api,vite}-review-3.log.
  • Screenshots: None—no unrelated or fabricated images used.

BLOCKED: Browser sandbox restrictions prevent producing visual screenshots.

@antosubash

Copy link
Copy Markdown
Owner Author

⛔ Automatic CI repair could not continue. Add a new /pi retry comment after resolving the blocker.

Pi CI repair failed: Visual sandbox requires a private writable runtime directory at /run/user/1000

@antosubash

Copy link
Copy Markdown
Owner Author

/pi retry

@antosubash

Copy link
Copy Markdown
Owner Author

🔄 CI repair retry queued for the current failed head.

@antosubash

Copy link
Copy Markdown
Owner Author

🔧 CI repair attempt 1 pushed. I will monitor the new checks automatically.

Root cause

Pytest collected two modules named test_settings.py, causing an import-file mismatch during full collection.

Change

Renamed:

  • modules/background_tasks/tests/test_settings.py
  • modules/background_tasks/tests/test_background_tasks_settings.py

Test contents were preserved exactly.

Verification

  • uv run pytest --collect-only -q — collection succeeded.
  • Full make test-py with local Moto endpoint proxy bypass — 2059 passed, 4 skipped.
  • make test-js110 passed.
  • make lint — passed.
  • git diff --check — passed.

The initial local full-test S3 errors were caused by the environment proxy intercepting Moto’s 0.0.0.0 endpoint; rerunning with that local endpoint excluded passed.

…nd-tasks-settings-form-accepts-u

# Conflicts:
#	modules/users/users/pages/Users/AddPeople.tsx
#	modules/users/users/pages/Users/components/InviteFields.tsx
#	vitest.config.mts
@antosubash

Copy link
Copy Markdown
Owner Author

🔧 CI repair attempt 2 pushed. I will monitor the new checks automatically.

Root cause

New toast and invite-validation text bypassed the repository’s required i18n path, so ci-check-untranslated failed.

Changed files

  • Added settings save-toast and invite invalid-email locale keys.
  • Routed both UI messages through t(keys.… ).
  • Regenerated packages/i18n/src/{generated-resources,keys.generated}.ts.
  • Updated component tests to initialize translated messages.

Verification

  • make ci-check-untranslated — passed.
  • Focused Vitest — 7 passed.
  • make test — 2160 Python passed, 2 skipped; 129 JS passed.
  • make lint — passed (existing unrelated Biome unused-import warning only).
  • make doctor — 0 errors; existing SM003 AuditLog warning.
  • git diff --check — passed.

Remaining risks

None for this CI failure.

@antosubash
antosubash marked this pull request as ready for review August 22, 2026 21:14
@antosubash

Copy link
Copy Markdown
Owner Author

✅ CI checks passed after 2 automatic repair attempts.

@antosubash

Copy link
Copy Markdown
Owner Author

/pi add visual feedback

@antosubash

Copy link
Copy Markdown
Owner Author

✅ Feedback processed and an update was pushed.

  • Feedback: Add visual feedback.

    • Replaced the unpainted save toast with persistent inline “Settings saved” feedback after a successful save.
    • Preserves saved baseline state and clears confirmation when fields/modules change.
  • Changed files:

    • modules/settings/settings/pages/components/ModuleForm.tsx
    • modules/settings/tests-js/ModuleForm.test.tsx
  • Checks:

    • make test-js — 129 passed.
    • make lint && make ci-check-untranslated — passed (existing unrelated Biome warning only).
    • Focused Vitest, TypeScript, Biome, and translation checks — passed.
    • git diff --check — passed.
  • Visual evidence:

    • .qa/issues/270/pr-279/runs/20260822T211717Z/report.md
    • 01-desktop-bounded-settings-validation.png
    • 02-desktop-settings-save-feedback.png
    • 03-desktop-invalid-invite-warning.png
    • 04-mobile-invalid-invite-warning.png
    • snapshot.txt, console.log, requests.txt
  • Risk/blocker: Local UI verification passed. Browser diagnostics only show the sandbox-blocked Google Fonts CDN request (ERR_INTERNET_DISCONNECTED); local app interactions succeeded.

@antosubash

Copy link
Copy Markdown
Owner Author

✅ CI checks passed for this pull request.

@antosubash

Copy link
Copy Markdown
Owner Author

/pi verify gif

@antosubash

Copy link
Copy Markdown
Owner Author

⛔ I could not process this feedback. Add a new /pi retry comment after resolving the blocker.

  • Feedback /pi verify gif: attempted workflow recording and completed asserted visual checks.
  • BLOCKED: playwright-cli video-start could not record because Playwright FFmpeg is missing at /home/anto/.cache/ms-playwright/ffmpeg-1011/ffmpeg-linux. No WebM/GIF was fabricated.
  • Screenshot verification passed for bounds validation, persistent save feedback, and desktop/mobile invite validation.

Evidence: .qa/issues/270/pr-279/runs/20260822T214026Z/report.md
Diagnostics and exact recording failure: .qa/issues/270/pr-279/runs/20260822T214026Z/playwright.log

Checks: app launch/authentication and asserted Playwright workflow passed; git diff --check passed.

Visual evidence captured locally under ignored .qa/issues/270/pr-279/runs/20260822T214026Z:

  • 01-desktop-bounded-settings-validation.png
  • 02-desktop-settings-save-feedback.png
  • 03-desktop-invalid-invite-warning.png
  • 04-mobile-invalid-invite-warning.png
  • report.md
  • requests.txt
  • snapshot.txt

@antosubash

Copy link
Copy Markdown
Owner Author

/pi verify gif

@antosubash

Copy link
Copy Markdown
Owner Author

✅ Feedback processed with no tracked code changes. GIF created at .qa/issues/270/pr-279/runs/20260822T214553Z/workflow.gif.

  • Feedback /pi verify gif: completed visual verification and recorded WebM.
  • Evidence: .qa/issues/270/pr-279/runs/20260822T214553Z/workflow.webm
    • Report: .../report.md
    • Desktop/mobile screenshots, snapshot, console, and failed-request logs are in the same directory.
  • Verified: bounds validation, persistent “Settings saved” feedback, and desktop/mobile invalid-invite feedback.
  • Checks: documented dependency install, isolated app launch/authentication, asserted Playwright workflow, git diff --check.
  • Diagnostics: only the sandbox-blocked Google Fonts request failed; local interactions passed. No source changes.

Visual evidence captured locally under ignored .qa/issues/270/pr-279/runs/20260822T214553Z:

  • 01-desktop-bounded-settings-validation.png
  • 02-desktop-settings-save-feedback.png
  • 03-desktop-invalid-invite-warning.png
  • 04-mobile-invalid-invite-warning.png
  • report.md
  • requests.txt
  • snapshot.txt
  • workflow.gif
  • workflow.webm

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.

background_tasks: settings form accepts unbounded numeric values and gives no save feedback

1 participant