Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Storage Sendable #3056

Merged
merged 27 commits into from Aug 28, 2023
Merged

Make Storage Sendable #3056

merged 27 commits into from Aug 28, 2023

Conversation

0xTim
Copy link
Member

@0xTim 0xTim commented Aug 19, 2023

Make Vapor's Storage and Application Sendable. This is a key piece in allowing Request and Response to be Sendable.

Note that types that are stored in Storage should now be Sendable. If you get any warnings, you may need to update your code for this new change.

@0xTim 0xTim added the semver-minor Contains new API label Aug 19, 2023
@0xTim 0xTim marked this pull request as ready for review August 19, 2023 15:59
@0xTim 0xTim requested a review from gwynne as a code owner August 19, 2023 15:59
@0xTim
Copy link
Member Author

0xTim commented Aug 19, 2023

Need to be careful here on how the Sendable stuff changes things like Authentication in Fluent

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2023

Codecov Report

Merging #3056 (4f028cb) into main (1bb4a2e) will increase coverage by 0.41%.
The diff coverage is 85.44%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3056      +/-   ##
==========================================
+ Coverage   76.64%   77.05%   +0.41%     
==========================================
  Files         211      211              
  Lines        7805     7871      +66     
==========================================
+ Hits         5982     6065      +83     
+ Misses       1823     1806      -17     
Files Changed Coverage Δ
Sources/Vapor/Authentication/Authenticator.swift 57.89% <ø> (ø)
Sources/Vapor/Authentication/GuardMiddleware.swift 100.00% <ø> (ø)
...rces/Vapor/Authentication/RedirectMiddleware.swift 83.33% <ø> (ø)
Sources/Vapor/Cache/CacheExpirationTime.swift 70.00% <ø> (ø)
Sources/Vapor/Client/Client.swift 46.66% <ø> (ø)
Sources/Vapor/Client/ClientRequest.swift 48.00% <ø> (ø)
Sources/Vapor/Commands/ServeCommand.swift 85.18% <ø> (ø)
Sources/Vapor/Content/PlaintextEncoder.swift 37.68% <0.00%> (ø)
...es/Vapor/HTTP/Server/Application+HTTP+Server.swift 96.15% <ø> (ø)
Sources/Vapor/Routing/Routes.swift 80.00% <ø> (ø)
... and 29 more

... and 1 file with indirect coverage changes

@0xTim
Copy link
Member Author

0xTim commented Aug 23, 2023

@gwynne @FranzBusch @fabianfett this is ready for review if anyone would like to take a look

Sources/Vapor/Application.swift Show resolved Hide resolved
Sources/Vapor/HTTP/EndpointCache.swift Outdated Show resolved Hide resolved
Sources/Vapor/HTTP/Server/HTTPServer.swift Outdated Show resolved Hide resolved
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@0xTim 0xTim merged commit d53f7fd into main Aug 28, 2023
15 of 16 checks passed
@0xTim 0xTim deleted the sendable-storage branch August 28, 2023 14:07
@penny-for-vapor
Copy link

These changes are now available in 4.80.0

keniwhat pushed a commit to keniwhat/vapor that referenced this pull request Aug 29, 2023
* main: (75 commits)
  Make Storage Sendable (vapor#3056)
  Add Sendable Conformances to undelying types (vapor#3054)
  Resolve issue vapor#2650 (vapor#2674)
  Fix for vapor#2574 Missing quote from value (vapor#2839)
  Allow specifying a timeout for client requests (vapor#3043)
  Update dependencies with known CVEs to the latest versions (vapor#3038)
  Create CODEOWNERS
  Improve error reporting for `EncodingError` and `DecodingError` (vapor#2981)
  Fix incorrect use of non-localhost connection in test
  Update README with new Sponsor (vapor#3025)
  Add `ContentContainer.decode(_:as:)` (vapor#3023)
  Fixed drain handler call order in case of asynchronous buffer handling (vapor#3009)
  Update README with new Sponsor (vapor#3024)
  Update README with new Sponsor (vapor#3020)
  Don't use UnsafeRawBufferPointer.withMemoryRebound(to:_:) before Swift 5.7.2 (vapor#3021)
  Avoid deadlocking websocket tests (vapor#3019)
  Update README with new Sponsor (vapor#3014)
  Fix `Range: bytes=0-0` header not working properly (vapor#3010)
  Remove use of HTTPBin (vapor#3017)
  Improved error logging (vapor#3016)
  ...

# Conflicts:
#	Sources/Vapor/HTTP/Headers/HTTPHeaders+ContentRange.swift
#	Sources/Vapor/Utilities/FileIO.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Contains new API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants