Bug Description
The /generate_gform endpoint currently returns a raw JSON response containing only responderUri, while web and extension clients expect a structured object with form_link.
This causes inconsistent handling and can result in undefined URL opening behavior.
Current Behavior
- Backend returns non-uniform response shape.
- Frontend/extension tries to read
result.form_link.
- In some flows, URL resolution is inconsistent.
Expected Behavior
- Backend should return a consistent JSON contract:
- Clients should open
form_link reliably.
- Invalid payloads should return clear
400 errors.
Proposed Fix
- Normalize backend response schema in
/generate_gform.
- Add input validation for
qa_pairs type.
- Remove server-side browser tab opening side effect.
- Add backward-compatible URL handling in clients for legacy and new response formats.
Steps to Reproduce
- Generate questions in EduAid web or extension.
- Click "Generate Google Form".
- Observe response parsing mismatch (backend vs consumer expectation).
Logs and Screenshots
No response
Environment Details
- Backend: Flask
- Clients: EduAid Web + Extension
Impact
Medium - Feature works but has issues
Code of Conduct
Bug Description
The
/generate_gformendpoint currently returns a raw JSON response containing onlyresponderUri, while web and extension clients expect a structured object withform_link.This causes inconsistent handling and can result in undefined URL opening behavior.
Current Behavior
result.form_link.Expected Behavior
form_linkedit_linkform_linkreliably.400errors.Proposed Fix
/generate_gform.qa_pairstype.Steps to Reproduce
Logs and Screenshots
No response
Environment Details
Impact
Medium - Feature works but has issues
Code of Conduct