Skip to content

Conversation

@damacus
Copy link
Owner

@damacus damacus commented Jan 23, 2026

Fixes #11

Summary

When browsing buckets with many objects, IronBuckets was loading all objects into memory, causing OOMKilled errors in Kubernetes.

Changes

New Methods

  • ListObjectsPaginated: Returns a limited number of objects with pagination support (MaxKeys limit + continuation token)
  • ListObjectsChannel: Returns a channel for streaming object iteration without loading all into memory

Handler Updates

  • BrowseBucket: Now uses pagination (100 objects per page) with "Load More" support
  • DeleteFolder: Streams objects and deletes one at a time instead of loading all into memory
  • DownloadZip: Streams objects into ZIP instead of loading all into memory first

Types Added

  • ListObjectsOptions - Pagination options (Prefix, Recursive, MaxKeys, ContinuationToken)
  • ListObjectsResult - Paginated results (Objects, IsTruncated, NextContinuationToken)
  • DefaultPageSize constant (100)

Testing

  • All existing tests pass
  • Updated journey tests to use new paginated/streaming methods
  • Added unit tests for pagination types

Fixes #11

- Add ListObjectsPaginated method with MaxKeys limit and continuation token
- Add ListObjectsChannel method for streaming object iteration
- Update BrowseBucket to use pagination (100 objects per page)
- Update DeleteFolder to stream objects instead of loading all into memory
- Update DownloadZip to stream objects instead of loading all into memory
- Add pagination types: ListObjectsOptions, ListObjectsResult
- Update mocks and journey tests for new methods
@damacus damacus enabled auto-merge (squash) January 23, 2026 12:40
@damacus damacus merged commit 031a864 into main Jan 23, 2026
3 of 4 checks passed
@damacus damacus deleted the fix/11-pagination-list-objects branch January 23, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Use pagination for ListObjects to reduce memory usage

1 participant