Repository navigation
fix(content): allow adding rules over HTTP - #155
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
TypeError: crypto.randomUUID is not a functionbefore 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.isSecureContext === falseandcrypto.randomUUIDunavailable: 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.Checklist