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

fix: ElectronBrowserContext::PartitionKey comparisons #41055

Merged
merged 2 commits into from Jan 23, 2024

Commits on Jan 19, 2024

  1. fix: ElectronBrowserContext::PartitionKey comparisons

    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 committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    7eb9a4e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    050ecff View commit details
    Browse the repository at this point in the history