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

Feature: Differentiate between cookies blocked in request or response #474

Merged
merged 18 commits into from
Feb 7, 2024

Conversation

ayushnirwal
Copy link
Contributor

@ayushnirwal ayushnirwal commented Feb 5, 2024

Description

A cookie can be blocked in 2 ways -

  • Inbound - While accepting a cookie, a browser may block ( reject ) a cookie in the 'set-cookie' header.
  • outbound - While associating a cookie to a request, a browser may decide not to add the cookie to the request's 'cookie' header.

This PR aims to handle that distinction while handling cookie-related information and displaying the data in the devtools panel.

An entry related to a cookie will be highlighted in yellow in the following cases.

  • A cookie blocked to be saved in the browser in all of the set-cookie response headers.

An entry related to a cookie will have a warning symbol in front of the cell containing its name.

  • A cookie blocked to be saved in the browser in at least one but not all of the set-cookie response headers.
  • A cookie blocked to be associated with at least one of the requests.

Relevant Technical Choices

  • Add network event history array to the CookieData type.
  • Add blocking status flags to the CookieData type.
  • Add utility function deriveBlockingStatus to derive blocking status from network events history.
  • Add enums for identifying network events while debugging and calculating blocking status.
  • Update display components bodyRow and bodyCell to handle adding a warning icon before the cell's content.
  • Update logic for highlighting a row in the component bodyRow.

Screenshot/Screencast

Screenshot 2024-02-05 at 1 19 13 PM


Checklist

  • I have thoroughly tested this code to the best of my abilities.
  • I have reviewed the code myself before requesting a review.
  • This code is covered by unit tests to verify that it works as intended.
  • The QA of this PR is done by a member of the QA team (to be checked by QA).

Fixes #381

@ayushnirwal ayushnirwal self-assigned this Feb 5, 2024
Copy link
Collaborator

@amovar18 amovar18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mohdsayed mohdsayed merged commit 5e57936 into develop Feb 7, 2024
4 checks passed
@mohdsayed mohdsayed deleted the feat/blocking-status branch February 7, 2024 09:04
@mohdsayed mohdsayed mentioned this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distinguish between cookie blocking on network response vs. network requests
3 participants