Merge pull request #2471 from basecamp/fix-crash-during-export

Fix crash during export
This commit is contained in:
Stanko Krtalić
2026-02-02 20:12:51 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ module Card::Exportable
end
def collect_attachments
attachments.to_a + comments.flat_map { |c| c.attachments.to_a }
(attachments.to_a + comments.flat_map { |c| c.attachments.to_a }).uniq(&:blob_id)
end
def export_status
+6 -1
View File
@@ -44,7 +44,12 @@ class ZipFile
# ActiveStorage's upload method expects a read-based IO, but ZipKit
# needs a write-based stream. The TransferManager's upload_stream
# yields a writable IO that we can stream directly to.
service.send(:upload_stream, key: blob.key, part_size: 100.megabytes) do |write_stream|
service.send(:upload_stream,
key: blob.key,
content_type: "application/zip",
part_size: 100.megabytes,
**service.upload_options
) do |write_stream|
write_stream.binmode
writer.stream_to(write_stream)
yield writer