- Issue created by @c. s. comfort
- Status changed to Fixed
almost 2 years ago 2:12am 8 April 2023 - πΊπΈUnited States cmlara
Yes it is expected that the s3fs module decorates the core file_system service (sits in the middle intercepting s3fs related requests and passing all others to the core file_system service or any other decorators.)
See #2972161: File operations return successful even when they fail β and π copy(), move(), and move_uploaded_file() ignores return value of stream_flush() Needs work for the primary reason as to why we decorate the file_system service to prevent data loss.
The file_system service is used by core for writes to any scheme, including the always enabled s3:// scheme A scheme does not need to be the default scheme for Drupal to utilize it for storage, as such we must always enable the decorator when the s3fs module is enabled.
Code that has services injected should generally use an interface for the typehint instead of a concrete class to avoid issues when other modules replace or decorate a service. In this scenario the typehint should generally be FileSystemInterface instead of FileSystem.
@cmlara -- indeed, an oversight on my part. Thanks for the thoughtful reply. Cheers.
- Status changed to Fixed
almost 2 years ago 5:49am 22 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.