Skip to content

fix(questionnaires): fix public vendor form failing to load#445

Merged
AndreLiar merged 4 commits into
mainfrom
dev
Jun 15, 2026
Merged

fix(questionnaires): fix public vendor form failing to load#445
AndreLiar merged 4 commits into
mainfrom
dev

Conversation

@AndreLiar

Copy link
Copy Markdown
Owner

Summary

Promotes dev → main. Single change since last main deploy:

  • publicApiBaseURL appended /api/v1 onto NEXT_PUBLIC_API_URL, which already contains it, producing a double-prefixed /api/v1/api/v1/... request that 404s for the vendor-facing /q/:token form.
  • requireActivePlan was applied to the whole /api/v1/questionnaires mount, including the public /respond/:token routes — 402ing the form when the visiting browser carries a session cookie for an org with planStatus not active/trialing (the reporter's org is currently paused). Moved both routes to a new unguarded questionnairePublicRoutes.js, mounted ahead of the plan gate.

Fixes the reported error on https://retrieva.online/q/<token>: "Unable to load questionnaire. Please try again." (see #444 for full details and local validation).

Test plan

)

the embedding phase (multi-query expansion via cpu-only ollama) can take
several minutes. nginx's proxy_read_timeout (60s default) was killing the
idle sse connection before any event was flushed, leaving the ui stuck on
"retrieving context…" forever.

send a sse comment (: keepalive) every 20s to keep the connection alive
through the entire pipeline duration.
the setup form was showing the raw otpauth:// url as plain text.
users had to manually copy a long secret into their authenticator app.
now shows a scannable qr code image (qrcode.react) + keeps the secret
as a manual-entry fallback below.

also clarifies the step 1 label to mention microsoft authenticator / google
authenticator explicitly.
publicApiBaseURL appended /api/v1 onto NEXT_PUBLIC_API_URL, which
already contains it, producing a double-prefixed /api/v1/api/v1
request that 404s.

Also unmount /respond/:token from requireActivePlan: it ran for any
visitor whose browser carries a session cookie (e.g. the workspace
owner previewing their own link), 402ing a token-gated public route
that vendors with no Retrieva account must reach. Moved both routes
to a new unguarded questionnairePublicRoutes router mounted ahead of
the plan gate.
…refix

fix(questionnaires): fix public vendor form failing to load
@codecov-commenter

codecov-commenter commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/controllers/ragController.js 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AndreLiar AndreLiar merged commit 8a70110 into main Jun 15, 2026
14 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.

2 participants