Skip to content

Commit 5d1531d

Browse files
Revert "Add walkthrough comments explaining log-vs-failure for nil records"
This reverts commit 6862576.
1 parent 6862576 commit 5d1531d

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

libs/SalesforceSDKCore/SalesforceSDKCoreTests/SalesforceRestAPITests.m

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,29 +654,23 @@ - (void)testCreateQuerySearchDelete {
654654
}
655655
}
656656

657-
// Post-delete verification: confirm SOQL no longer returns the record.
658-
// If records is nil, the server was unreachable during the entire polling window.
659-
// We log rather than fail because: (1) delete already asserted success in @finally above,
660-
// (2) queryAll below separately verifies the record is in the recycle bin, and
661-
// (3) this step only checks index consistency — not SDK correctness.
662-
// A hard assertion here caused ~1-in-10 CI flakes when SOQL was transiently unreachable.
657+
// well, let's do another query just to be sure — use retry since SOQL can briefly show stale results after delete
663658
request = [[SFRestAPI sharedInstance] requestForQuery:[NSString stringWithFormat:@"select Id, FirstName from Contact where LastName='%@'", lastName] apiVersion:kSFRestDefaultAPIVersion];
664659
NSArray *records = [self sendSyncQueryRequestUntilEmpty:request maxWaitSeconds:30];
665660
if (records) {
666661
XCTAssertEqual((int)[records count], 0, @"expected no result");
667662
} else {
668663
NSLog(@"[testCreateQuerySearchDelete] SOQL poll never got a valid response — server may have been briefly unreachable during post-delete verification");
669664
}
670-
665+
671666
// check the deleted object is here
672667
request = [[SFRestAPI sharedInstance] requestForQueryAll:[NSString stringWithFormat:@"select Id, FirstName from Contact where LastName='%@'", lastName] apiVersion:kSFRestDefaultAPIVersion];
673668
response = [self sendSyncRequest:request];
674669
XCTAssertEqualObjects(response.returnStatus, kTestRequestStatusDidLoad, @"queryAll request failed");
675670
NSArray* records2 = ((NSDictionary *)response.dataResponse)[RECORDS];
676671
XCTAssertEqual((int)[records2 count], 1, @"expected just one query result");
677672

678-
// Post-delete SOSL verification: same rationale as SOQL above.
679-
// SOSL de-indexing has additional server-side lag beyond SOQL consistency.
673+
// now search object — use retry since SOSL de-indexing has server-side lag
680674
request = [[SFRestAPI sharedInstance] requestForSearch:[NSString stringWithFormat:@"Find {%@}", lastName] apiVersion:kSFRestDefaultAPIVersion];
681675
records = [self sendSyncSearchRequestUntilEmpty:request maxWaitSeconds:45];
682676
if (records) {

0 commit comments

Comments
 (0)