Skip to content

Commit aab707e

Browse files
committed
CodeRabbitAI nitpicks
1 parent 26d407d commit aab707e

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

packages/dart/lib/src/network/parse_network_retry.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,9 @@ Future<T> executeWithRetry<T extends ParseNetworkResponse>({
158158
///
159159
/// Retry Triggers:
160160
///
161-
/// - Status code `-1` (network/parsing errors)
162-
/// - HTML responses from proxies/load balancers (502, 503, 504 errors)
163-
/// - Socket exceptions, timeouts, DNS failures
164-
/// - JSON parse errors from malformed responses
161+
/// - Status code `-1` (network/parsing errors from the HTTP client layer)
162+
/// Note: HTML responses, socket exceptions, timeouts, and parse errors
163+
/// are converted to status -1 by the HTTP client before reaching here.
165164
///
166165
/// No Retry:
167166
///

packages/dart/test/src/network/parse_client_retry_integration_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ void main() {
150150

151151
expect(callCount, 1); // No retry via mock
152152
expect(fetchedObject.objectId, 'abc123'); // Original objectId preserved
153+
// Note: fetch() returns ParseObject, not ParseResponse - success check not applicable
153154
},
154155
);
155156

packages/dart/test/src/network/parse_network_retry_test.dart

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ void main() {
211211
final duration = DateTime.now().difference(startTime);
212212

213213
// Should have at least 300ms delay (100 + 200)
214-
// Allow some variance for test execution
215-
expect(duration.inMilliseconds, greaterThan(250));
214+
// Allow more variance for CI environments with resource contention
215+
expect(duration.inMilliseconds, greaterThan(200));
216216

217217
ParseCoreData().restRetryIntervals = oldIntervals;
218218
});
@@ -282,16 +282,8 @@ void main() {
282282
});
283283

284284
group('_shouldRetryResponse', () {
285-
test('should return true for status code -1', () {
286-
final response = ParseNetworkResponse(
287-
data: '{"code":-1,"error":"NetworkError"}',
288-
statusCode: -1,
289-
);
290-
291-
// We can't directly test the private function, but we can test via executeWithRetry
292-
// This test documents the expected behavior
293-
expect(response.statusCode, -1);
294-
});
285+
// Note: _shouldRetryResponse is a private function tested indirectly via executeWithRetry.
286+
// The retry behavior for status code -1 is validated by tests in the executeWithRetry group.
295287

296288
test('should detect HTML with <!DOCTYPE pattern', () async {
297289
int callCount = 0;

0 commit comments

Comments
 (0)