Revert "fix tests"

This reverts commit 07619950a1.
This commit is contained in:
chrislu
2025-07-21 09:46:26 -07:00
parent 7faf058d7b
commit 35262537f3
+15 -6
View File
@@ -150,11 +150,10 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
// check filer
err = s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
var lastEntryWasCommonPrefix bool
var lastCommonPrefixName string
for {
empty := true
var lastEntryWasCommonPrefix bool
var lastCommonPrefixName string
nextMarker, doErr = s3a.doListFilerEntries(client, reqDir, prefix, cursor, marker, delimiter, false, func(dir string, entry *filer_pb.Entry) {
empty = false
@@ -339,7 +338,6 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
return
}
if cursor.maxKeys <= 0 {
cursor.isTruncated = true
return
}
@@ -393,8 +391,18 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
}
}
if cursor.maxKeys <= 0 {
cursor.isTruncated = true
continue
// Check if there are more entries available by trying to peek at the next one
_, nextRecvErr := stream.Recv()
if nextRecvErr == nil {
// There is another entry available, so we're truncated
cursor.isTruncated = true
} else if nextRecvErr != io.EOF {
// Some other error occurred
err = fmt.Errorf("peeking next entry: %v", nextRecvErr)
return
}
// If nextRecvErr == io.EOF, there are no more entries, so isTruncated remains false
break
}
entry := resp.Entry
nextMarker = entry.Name
@@ -464,6 +472,7 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
// Create logical entries for objects that have .versions directories
for _, versionsDir := range versionsDirs {
if cursor.maxKeys <= 0 {
// We have versioned objects remaining but can't process them due to limit
cursor.isTruncated = true
break
}