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
fix: ElectronBrowserContext::PartitionKey comparisons #41055
Merged
Merged
Conversation
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
Use c++20 default comparisons to simplify + fix PartitionKey sorting: - The equality operator is broken. `PartitionKey{"foo", false}` is both equal, to and less than, `PartitionKey{"foo", true}` - For some keys, the same session can be retrieved via both `fromPath()` and `fromPartition()`. This use case was discussed and removed from the original PR after code review said "always returning different sessions feels lower maintenance." The current behavior is a bug that comes from the comparison operators not checking the keys' types. Xref: 3f1aea9#r1099745359 Xref: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md#Default-comparisons-allowed
ckerr
added
semver/patch
backwards-compatible bug fixes
target/27-x-y
PR should also be added to the "27-x-y" branch.
target/28-x-y
PR should also be added to the "28-x-y" branch.
target/29-x-y
PR should also be added to the "29-x-y" branch.
labels
Jan 19, 2024
zcbenz
approved these changes
Jan 23, 2024
Release Notes Persisted
|
I was unable to backport this PR to "27-x-y" cleanly; |
trop
bot
added
needs-manual-bp/27-x-y
and removed
target/27-x-y
PR should also be added to the "27-x-y" branch.
labels
Jan 23, 2024
I have automatically backported this PR to "28-x-y", please check out #41083 |
trop
bot
added
in-flight/28-x-y
and removed
target/28-x-y
PR should also be added to the "28-x-y" branch.
labels
Jan 23, 2024
I have automatically backported this PR to "29-x-y", please check out #41084 |
trop
bot
added
in-flight/29-x-y
and removed
target/29-x-y
PR should also be added to the "29-x-y" branch.
labels
Jan 23, 2024
trop
bot
added
merged/28-x-y
PR was merged to the "28-x-y" branch.
merged/29-x-y
PR was merged to the "29-x-y" branch.
and removed
in-flight/28-x-y
in-flight/29-x-y
labels
Jan 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged/28-x-y
PR was merged to the "28-x-y" branch.
merged/29-x-y
PR was merged to the "29-x-y" branch.
semver/patch
backwards-compatible bug fixes
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.
Description of Change
Use c++20 default comparisons to simplify + fix two bugs in PartitionKey sorting:
The equality operator is broken.
PartitionKey{"foo", false}
is both equal to, and less than,PartitionKey{"foo", true}
For some keys, the same session can be retrieved via both
fromPath()
andfromPartition()
. This use case was discussed and removed from the original PR after code review said "always returning different sessions feels lower maintenance." The current behavior is a bug that comes from the comparison operators not checking the keys' types.All reviews welcomed. CC @zcbenz as the 36728 reviewer who discussed the 'same session' use case
Checklist
npm test
passesRelease Notes
Notes: Fixed
session.fromPartition()
key lookup bug.