Skip to content

Commit 82ac4a1

Browse files
authored
PLU-507: FormSG error message when form is not public (#1224)
## Problem Unclear when form is not open to responses after form has been connected. ## Solution Returns the error message so that it is displayed on the UI. ## Before & After Screenshots **BEFORE**: <img width="1145" height="230" alt="Screenshot 2025-09-22 at 8 25 24 PM" src="https://github.com/user-attachments/assets/288733ee-112f-4bf7-bb4c-20a0886739be" /> <img width="634" height="375" alt="Screenshot 2025-09-22 at 8 25 31 PM" src="https://github.com/user-attachments/assets/3b0f59d1-b46a-4e53-85a1-02f543a1b6e1" /> **AFTER**: <img width="898" height="296" alt="Screenshot 2025-09-22 at 6 34 17 PM" src="https://github.com/user-attachments/assets/0afbaf30-07d8-471d-abb8-6b964568f2ec" /> <img width="638" height="447" alt="Screenshot 2025-09-22 at 6 34 24 PM" src="https://github.com/user-attachments/assets/5f9dc0c1-bd84-4116-b4d6-1bbd312b7eb4" /> ## Tests - [ ] Existing functionalities work - [ ] Can add new form - [ ] Can change form - [ ] Can reconnect form - [ ] "Ensure form is public" is shown correctly when attempting to connect a new form that is closed - [ ] Updated error message - [ ] "Ensure form is public" is shown correctly for a form that has already been connected
1 parent 6a57a01 commit 82ac4a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/backend/src/graphql/queries/test-connection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ const testConnection: QueryResolvers['testConnection'] = async (
3737

3838
// Verify connection
3939
let isStillVerified
40+
let errorMessage
4041
try {
4142
isStillVerified = !!(await app.auth.isStillVerified($))
4243
} catch (err) {
4344
isStillVerified = false
45+
errorMessage = err.message
4446
logger.error(`Error verifying CONNECTION ID: ${params.connectionId}`, {
4547
event: 'test-connection',
4648
flowId: params.flowId,
@@ -56,7 +58,7 @@ const testConnection: QueryResolvers['testConnection'] = async (
5658

5759
// if testing outside of the editor, it does not verify registration (e.g. setting of webhook url)
5860
if (!isStillVerified || !params.flowId) {
59-
return { connectionVerified: isStillVerified }
61+
return { connectionVerified: isStillVerified, message: errorMessage }
6062
}
6163

6264
// TODO (ogp-weeloong): We should actually _disallow_ testing connections

0 commit comments

Comments
 (0)