GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(cloudflare): align integration with live API, fix type-coercion bug by waleedlatif1 · Pull Request #5444 · simstudioai/sim Conversation
Collaborator
Summary
All changes were independently verified by 3 parallel audit passes against Cloudflare's live API docs, plus a dedicated backwards-compatibility check confirming no currently-working field was removed (the removed fields were all dead/broken against the live API already). Type of Change
TestingTested manually — lint and typecheck pass clean on all touched files. Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
- fix update_zone_setting body builder: was blindly JSON.parse-ing every value, silently coercing scalar settings (e.g. min_tls_version "1.2") to the wrong type; now only parses object/array literals - fix list_dns_records name/content/tag filters to use Cloudflare's exact-match dotted param names (name.exact/content.exact/tag.exact) - remove auto_minify (never a real setting ID) and minify (deprecated and removed from the live zone-settings API in Aug 2024) - remove dead jump_start param from create_zone (not part of the current POST /zones schema) - fix block bgColor from #F5F6FA to Cloudflare's actual brand orange #F38020 - add missing secondary zone type option and plan.id sort option - expand BlockMeta skills/templates
|
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
PR SummaryMedium Risk Overview
Create zone drops the unsupported Update zone setting UI and copy remove deprecated/invalid Two new BlockMeta skills cover zone provisioning and SPF/DKIM/DMARC setup. Reviewed by Cursor Bugbot for commit f3f3596. Configure here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@greptile review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8d72b05. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThis PR aligns the Cloudflare integration with the live API by fixing a real type-coercion bug in
Confidence Score: 5/5Safe to merge — all changes are targeted API-alignment fixes with no new logic paths that could cause regressions on currently-working settings. The body-builder rewrite in update_zone_setting.ts is the only non-trivial logic change, and it correctly handles every runtime type that can flow through the param. The DNS filter changes swap bare params for Cloudflare's documented exact-match equivalents. Removed fields were already broken against the live API. No currently-working code path is regressed. No files require special attention. update_zone_setting.ts received the most logic change and is well-commented. Important Files Changed
Reviews (7): Last reviewed commit: "revert(cloudflare): keep original block ..." | Re-trigger Greptile |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Greptile SummaryThis PR aligns the Cloudflare integration with the live API by fixing a type-coercion bug, correcting DNS record filter params, and removing stale/deprecated fields and settings.
Confidence Score: 4/5Safe to merge; all changes are API-alignment fixes and deprecation removals with no core path regressions. The update_zone_setting body builder is materially improved — the previous blind JSON.parse coerced "1.2" to 1.2 and broke the Cloudflare API; the new dispatch is correct for every setting in the exposed dropdown. The trimmed variable is computed but the three fallback return paths use params.value instead, meaning whitespace-padded inputs for string settings (e.g. " on ") are sent unstripped to the API. This is a pre-existing quirk carried over from the old catch block, but since trimmed is now available it should be used consistently. The remaining changes (DNS exact-match params, deprecated field removal, brand color, new zone type, sort option) are straightforward and well-documented. apps/sim/tools/cloudflare/update_zone_setting.ts — the trimmed/params.value inconsistency in the fallback returns warrants a look before merge. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[update_zone_setting called] --> B[trimmed = params.value.trim]
B --> C{settingId is browser_cache_ttl?}
C -->|Yes| D[numeric = Number of trimmed]
D --> E{isNaN?}
E -->|Yes| F[send string fallback]
E -->|No| G[send as integer]
C -->|No| H{trimmed starts with curly or bracket?}
H -->|Yes - JSON literal| I[JSON.parse trimmed]
I --> J{Parse OK?}
J -->|Yes| K[send as parsed object or array]
J -->|No| L[send string fallback]
H -->|No - plain scalar| M[send as string e.g. full or on or 1.2]
G --> N[PATCH /zones/:id/settings/:settingId]
K --> N
M --> N
F --> N
L --> N
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[update_zone_setting called] --> B[trimmed = params.value.trim]
B --> C{settingId is browser_cache_ttl?}
C -->|Yes| D[numeric = Number of trimmed]
D --> E{isNaN?}
E -->|Yes| F[send string fallback]
E -->|No| G[send as integer]
C -->|No| H{trimmed starts with curly or bracket?}
H -->|Yes - JSON literal| I[JSON.parse trimmed]
I --> J{Parse OK?}
J -->|Yes| K[send as parsed object or array]
J -->|No| L[send string fallback]
H -->|No - plain scalar| M[send as string e.g. full or on or 1.2]
G --> N[PATCH /zones/:id/settings/:settingId]
K --> N
M --> N
F --> N
L --> N
Reviews (2): Last reviewed commit: "fix(cloudflare): reject empty browser_ca..." | Re-trigger Greptile |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- use trimmed value consistently in update_zone_setting fallback paths - document that tag_match has no effect with a single exact-match tag filter (Cloudflare's API only combines multiple tag conditions)
|
Addressed the tag_match/tag.exact semantics note from the Greptile summary (Comments Outside Diff) in 493cb56 — updated the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@greptile review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Wand-generated or block-referenced values can arrive as a number at runtime despite the declared string param type, which crashed the body builder's .trim() call.
|
@greptile review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…description - coerce null/undefined value to empty string instead of literal "null"/"undefined" strings before trimming - fix stale block-level 'tag' input description left over from the comma-separated-tags -> exact-match-tag filter fix
|
@greptile review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
A block-referenced array/object value was being blindly stringified
before the JSON-shape check, so String([...]) comma-joined arrays and
String({...}) produced the literal "[object Object]" instead of the
JSON shape Cloudflare expects (e.g. for ciphers). Already-structured
values now pass straight through.
|
@greptile review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit cb2004b. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@greptile review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cursor review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f3f3596. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f3f35966
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.