Handle 413 with user friendly message#17870
Conversation
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts">
<violation number="1" location="packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts:240">
P2: This test can pass without any assertions if makeRequest resolves. Use a rejection assertion (or expect.assertions) so the test fails when the 413 handling isn’t triggered.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| }), | ||
| ); | ||
|
|
||
| try { |
There was a problem hiding this comment.
P2: This test can pass without any assertions if makeRequest resolves. Use a rejection assertion (or expect.assertions) so the test fails when the 413 handling isn’t triggered.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/apollo/services/__tests__/apollo.factory.test.ts, line 240:
<comment>This test can pass without any assertions if makeRequest resolves. Use a rejection assertion (or expect.assertions) so the test fails when the 413 handling isn’t triggered.</comment>
<file context>
@@ -226,4 +228,21 @@ describe('ApolloFactory', () => {
+ }),
+ );
+
+ try {
+ await makeRequest();
+ } catch (error) {
</file context>
Greptile OverviewGreptile SummaryThis PR adds a user-friendly handling path for HTTP 413 (Payload Too Large) errors coming from the upstream proxy by introducing an The change integrates into the existing Apollo link chain by (1) preventing retries for 413 in Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Frontend UI
participant AF as ApolloFactory
participant RL as RetryLink
participant EL as ErrorLink
participant GW as Gateway/Proxy
UI->>AF: client.mutate/query
AF->>RL: execute operation
RL->>GW: HTTP request
GW-->>RL: 413 Payload Too Large
RL->>RL: retryIf(error)
RL-->>EL: propagate networkError
EL->>AF: isPayloadTooLargeError(networkError)
AF-->>EL: true
EL->>UI: onPayloadTooLarge(message)
UI->>UI: show error snackbar (deduped)
|
Additional Comments (1)
Fix by guarding/casting before calling, or by making the helpers accept |
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:59954 This environment will automatically shut down when the PR is closed or after 5 hours. |
|
Hey @etiennejouan! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
1 similar comment
|
Hey @etiennejouan! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
Add friendly message for 413 errors. Currently, 413 errors originate from the nginx server.