Skip to content

Fix tenant file access and queue questionnaire auto-fill (QT-001–004) - #15

Open
rahuliitk wants to merge 2 commits into
mainfrom
bug-fixes
Open

rahuliitk wants to merge 2 commits into
mainfrom
bug-fixes

Conversation

@rahuliitk

Copy link
Copy Markdown
Contributor

File routes trusted the organization in the URL and accepted arbitrary storage buckets. They now verify organization access, restrict access to the configured evidence bucket, and require the exact organization key prefix. Questionnaire Auto-fill previously waited for all AI batches inside the HTTP request; it now returns 202 with a persisted job and runs in a background worker, with progress, saved answers and retry controls in the frontend.

Scope

  • QT-001: retain existing JWT/configuration protections and add rejection regression tests; the reported issue was not reproduced locally.
  • QT-002: fix file upload/download/delete authorization with mocked-storage regression tests. Preserve the explicit super-admin override.
  • QT-003: add route and database search-isolation tests; no leakage reproduced in the tested search path.
  • QT-004: add a PostgreSQL-backed queue with concurrent submission deduplication, exclusive worker claims, execution deadlines, interruption handling and preservation of saved answers. Prevent edits during processing and scope job status to the organization.
  • Add progress polling, completion refresh and failure/retry UI, plus mobile navigation so questionnaire controls remain usable.
  • Include schema reconciliation 0013, framework timestamp correction 0014, Docker development test dependencies and the frontend content-path correction.

Validation

  • 29 targeted backend tests passed.
  • Four frontend tests and TypeScript checking passed.
  • PostgreSQL migration/seed regression tests passed; queue concurrency and saved-answer integration was rerun successfully against final head 0014.
  • Playwright checks with mocked API responses covered desktop/mobile, progress after reload, completion, failure/retry controls and keyboard navigation. Screenshots reviewed.
  • git diff --check passed.

Deployment and remaining checks

Deploy frontend and backend together: Auto-fill changes from a 200/message response to 202/job metadata. Apply migrations through 0014 first. Migration 0013 is forward-only; back up the database before applying it.

Real storage using two test accounts, real AI-provider behavior and production JWT configuration still require environment-specific verification. Local passing tests do not establish production readiness. See docs/qt-001-004-review.md for implementation details and repeatable test commands.

This branch has not been deployed

No deployments
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.

2 participants