Skip to content

fix(core): omit undefined permission metadata - #48495

Open
S1LentH3arT wants to merge 1 commit into
anomalyco:devfrom
S1LentH3arT:permission-metadata-dev
Open

fix(core): omit undefined permission metadata#48495
S1LentH3arT wants to merge 1 commit into
anomalyco:devfrom
S1LentH3arT:permission-metadata-dev

Conversation

@S1LentH3arT

Copy link
Copy Markdown

Issue for this PR

Closes #37650

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Pending permissions can contain optional metadata values set to undefined. The metadata is JSON-encoded when pending requests are listed, so those values cause the response encoding to fail.

This change removes only undefined metadata entries when PermissionV2 builds a request. It applies at the shared ask/assert boundary and keeps valid values such as false, 0, and null.

PRs #46964 and #46906 address the same bug pattern in the older Permission implementation on v2. This PR applies the fix to the current PermissionV2 implementation on dev; the normalization strategy is intentionally the same, not a separate algorithm.

How did you verify your code works?

  • bun --version -> 1.3.14
  • bun turbo typecheck --concurrency=2 -> 30 successful tasks
  • cd packages/core && bun test test/permission.test.ts -> 12 passed, 0 failed

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search results show that PRs #46964 and #46906 are related but not duplicates—they address the same bug pattern in the older Permission implementation, while PR #48495 applies the fix to PermissionV2 on dev. The PR description explicitly acknowledges this:

"PRs #46964 and #46906 address the same bug pattern in the older Permission implementation on v2. This PR applies the fix to the current PermissionV2 implementation on dev; the normalization strategy is intentionally the same, not a separate algorithm."

No duplicate PRs found

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.

tools: optional search metadata breaks pending permission listing

1 participant