discourse/lib/backup_restore
Jake Goldsborough 22898b52d9 FIX: Add extension/original_filename to UploadData struct
The UploadData struct introduced in 2bfeb87013 for S3 backup deduplication
was missing extension and original_filename attributes. These are required
by FileStore::BaseStore#get_path_for_upload when the URL does not match
the standard UPLOAD_PATH_REGEX pattern (original/\d+X/).

For uploads with non-standard URLs (migrated uploads, custom storage paths,
or corrupted URLs), the fallback path in get_path_for_upload would cause
NoMethodError when accessing upload.extension or upload.original_filename.

Now plucks these additional fields from the database and includes them in
the struct to ensure backups work regardless of URL format.

Also changes from Struct to Data.define for immutability, as suggested by
@ZogStriP - these value objects should not be mutated after creation.
2026-02-23 15:50:09 +00:00
..
backup_file_handler.rb FIX: Handle restore URLs ending with query params (#33384) 2025-07-07 18:43:31 +03:00
backup_store.rb FEATURE: Delete backups based on time window (#24296) 2023-12-13 13:00:27 -05:00
backuper.rb DEV: Add backuper.rb for autoload backwards compatibility 2026-01-22 23:03:23 +00:00
creator.rb FIX: Add extension/original_filename to UploadData struct 2026-02-23 15:50:09 +00:00
database_restorer.rb FIX: Remove unsupported SQL from DB dump during restore 2025-11-03 11:15:00 +01:00
factory.rb FIX: Restoring could fail due to missing path 2021-02-09 17:28:03 +01:00
local_backup_store.rb FEATURE: Delete backups based on time window (#24296) 2023-12-13 13:00:27 -05:00
logger.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
meta_data_handler.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
restorer.rb FIX: Reload site settings before seeding content during restore 2025-11-03 11:15:00 +01:00
s3_backup_store.rb DEV: Add setting to tag s3 objects enabling tag based access control policies (#32988) 2025-06-16 13:26:18 +08:00
system_interface.rb DEV: Fix sidekiq requires in test env 2025-07-22 12:40:57 +02:00
uploads_restorer.rb DEV: Hand-pick Rails/WhereNot autofixes (#35117) 2025-10-03 13:29:22 +02:00