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

feat: extended bit window in NetworkFilter #4509

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

seia-soto
Copy link
Member

This PR introduces a concept of sourceMask to extend mask of NetworkFilter from 32 bits to 48 bits (16+32). With this changes, we are able to keep supporting more options in NetworkFilter.

For the backward compatibility issues, we may accept two kinds of arguments from NetworkFilter then process them separately. For an instance, we can accept number | [number, number] in the argument object of the constructor function. Then we can build two corresponding mask from a single number depending on the previous format if number was given.

if (sourceMask === undefined) {
  // Build two bitmask referring to the legacy format.
  let sourceMask = 0;
  let mask = 0;
  if (getBit(mask, LEGACY_NETWORK_FILTER_MASK.firstParty)) {
    setBit(sourceMask, NETWORK_SOURCE_MASK.firstParty)
  }
  // Do same for all properties
}

With this structure, we can avoid breaking legacies.

@seia-soto seia-soto added PR: New Feature 🚀 Increment minor version when merged WIP labels Dec 10, 2024
@seia-soto seia-soto self-assigned this Dec 10, 2024
@seia-soto seia-soto changed the title feat: extended bit window in NetworkFilter feat: extended bit window in NetworkFilter Dec 10, 2024
@seia-soto
Copy link
Member Author

seia-soto commented Dec 11, 2024

Putting this off until we fully utilize 31st bit of network filter mask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: New Feature 🚀 Increment minor version when merged WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant