Skip to content

fix(content): allow adding rules over HTTP - #155

Merged
murongg merged 1 commit into
mainfrom
fix/content-rule-http
Nov 1, 2026
Merged

murongg merged 1 commit into
mainfrom
fix/content-rule-http

Conversation

@murongg

@murongg murongg commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

On plain HTTP origins, Content rules → Configure rules → Add rule crashes when crypto.randomUUID() is unavailable. Generate editor-local, monotonic draft IDs instead, so adding rules works over HTTP and deleting/re-adding a rule cannot reuse another row's state.

Regression tests cover the unavailable API, adding/testing/saving rules without retaining sensitive inputs, and independent drafts after removal.

Related issues

Closes #154

Validation

  • TDD: the regression reproduced TypeError: crypto.randomUUID is not a function before the fix; all 6 content-rule tests passed afterward.
  • make check: passed, including generated-query consistency, script checks, Go vet and race tests, frontend type/lint/format checks, all 544 frontend tests, and the production build. Script tests: 134 passed and 5 optional tests skipped by their default conditions.
  • Chromium against the production frontend on an insecure local HTTP origin, with isSecureContext === false and crypto.randomUUID unavailable: adding, editing, removing and re-adding drafts passed in English and Chinese, light and dark themes, at 1440px and 390px widths. Buttons also passed keyboard activation; no uncaught page errors or horizontal overflow.
  • Browser checks used synthetic local demo data; live deployment and other browsers were not exercised.

Checklist

  • The change is focused on one problem and follows CONTRIBUTING.md.
  • Behavior changes have regression tests using synthetic data only.
  • Validation results and any remaining gaps are documented above.
  • Relevant documentation and English/Chinese UI text are updated (not applicable: no copy or documented workflow changes).
  • UI changes are checked for keyboard access, narrow screens, light/dark themes, and English/Chinese.
  • No credentials, account identifiers, private request/response content, or local planning documents are included.

@murongg
murongg marked this pull request as ready for review November 1, 2026 12:00
@murongg
murongg merged commit 0224882 into main Nov 1, 2026
7 checks passed
@murongg
murongg deleted the fix/content-rule-http branch November 1, 2026 12:14
@murongg murongg mentioned this pull request Nov 1, 2026
6 tasks done
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.

[Bug]: 内容规则添加规则报错

1 participant