-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add a checksum field to DataResponseMetadata
, and use it for timezone consistency
#6046
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
86dd950
checksum
robertbastian ca21228
typos
robertbastian e122434
store checksum in data buffer
robertbastian 54b5762
fmt
robertbastian d9f0496
marker info flag
robertbastian 949b2a8
set flag
robertbastian c537ff9
use more
robertbastian 38c26c8
Merge branch 'main' into checksum
robertbastian 8d10580
tests
robertbastian 6011b64
\0c
robertbastian 5f2dcc3
todo
robertbastian 64798b6
regen
robertbastian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ pub trait MaybePayload<M: DynamicDataMarker, Variables>: UnstableSealed { | |
provider: &P, | ||
req: DataRequest, | ||
variables: Variables, | ||
) -> Result<Result<(), DataError>, MaybePayloadError> | ||
) -> Result<Result<DataResponseMetadata, DataError>, MaybePayloadError> | ||
where | ||
P: BoundDataProvider<M> + ?Sized, | ||
Self: Sized; | ||
|
@@ -199,15 +199,16 @@ where | |
provider: &P, | ||
req: DataRequest, | ||
variables: Variables, | ||
) -> Result<Result<(), DataError>, MaybePayloadError> | ||
) -> Result<Result<DataResponseMetadata, DataError>, MaybePayloadError> | ||
where | ||
P: BoundDataProvider<M> + ?Sized, | ||
Self: Sized, | ||
{ | ||
let arg_variables = variables; | ||
match &self.inner { | ||
OptionalNames::SingleLength { variables, .. } if arg_variables == *variables => { | ||
return Ok(Ok(())); | ||
// TODO(#6063): probably not correct | ||
return Ok(Ok(Default::default())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oof, is this ok? Or should we retain the |
||
} | ||
OptionalNames::SingleLength { .. } => { | ||
return Err(MaybePayloadError::ConflictingField); | ||
|
@@ -220,7 +221,7 @@ where | |
payload: response.payload, | ||
variables: arg_variables, | ||
}; | ||
Ok(Ok(())) | ||
Ok(Ok(response.metadata)) | ||
} | ||
Err(e) => Ok(Err(e)), | ||
} | ||
|
@@ -242,7 +243,7 @@ impl<M: DynamicDataMarker, Variables> MaybePayload<M, Variables> for () { | |
_: &P, | ||
_: DataRequest, | ||
_: Variables, | ||
) -> Result<Result<(), DataError>, MaybePayloadError> | ||
) -> Result<Result<DataResponseMetadata, DataError>, MaybePayloadError> | ||
where | ||
P: BoundDataProvider<M> + ?Sized, | ||
Self: Sized, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I prefer the previous style of separate functions for loading separate keys. One important decision here is that we use
Default
as the DataRequest, and I don't want to inline that assumption to a bunch of places.Just keep this function and make it return the DataResponseMetadata