Update OneDollarStats script handling - #698
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🚀 Preview Deployment ReadyVercel is rebuilding the frontend with the new Convex backend URL. Vercel will post the preview URL automatically. Convex Preview Backend
🤖 Deployed automatically by GitHub Actions |
|
✅ No security issues found — scanned commits: |
Greptile SummaryThis PR extracts the OneDollarStats analytics script URL into a named constant ( Key observations:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant CDN as assets.onedollarstats.com
participant OneDollarStats as OneDollarStats Collector
Browser->>Browser: Parse __root.tsx head scripts
Note over Browser: ONEDOLLARSTATS_SCRIPT_SRC constant<br/>resolves to stonks.js URL
Browser->>CDN: GET /stonks.js (defer, no SRI check)
CDN-->>Browser: stonks.js payload
Note over Browser: No integrity verification (SRI removed)
Browser->>Browser: Execute stonks.js
Browser->>OneDollarStats: Send page-view analytics event
Last reviewed commit: d9764d7 |
|
@macroscope-app review |
|
Review complete! No issues found. View the results here: |
ApprovabilityVerdict: Would Approve This is a minimal configuration change that extracts analytics script constants and updates an SRI integrity hash. The unresolved comment raises a valid operational concern about the SRI approach but doesn't identify a bug or security issue in the code itself. Macroscope would have approved this PR. Enable approvability here. |
|
@macroscope-app review |
|
✅ No security issues found — scanned commits: |
| src: ONEDOLLARSTATS_SCRIPT_SRC, | ||
| defer: true, | ||
| crossOrigin: "anonymous", | ||
| integrity: "sha384-JKNAwAZy8iZWcJrexWvQf3rNcosuH0th/rwqZoiM84ea7fMGTt2eq8ddZb//nd9H", | ||
| }, |
There was a problem hiding this comment.
crossOrigin: "anonymous" serves no purpose without integrity
The crossOrigin: "anonymous" attribute is primarily meaningful in combination with SRI (integrity). Its role is to tell the browser to make a CORS request so the response can be verified against the hash. Now that the integrity attribute has been removed, this attribute does nothing useful for a plain <script src> tag from a CDN — browsers already fetch cross-origin scripts without needing crossOrigin: "anonymous" set explicitly.
Confidence this is worth changing: 2/5 — it's harmless in practice, but keeping it is misleading and suggests SRI is still in play.
| src: ONEDOLLARSTATS_SCRIPT_SRC, | |
| defer: true, | |
| crossOrigin: "anonymous", | |
| integrity: "sha384-JKNAwAZy8iZWcJrexWvQf3rNcosuH0th/rwqZoiM84ea7fMGTt2eq8ddZb//nd9H", | |
| }, | |
| src: ONEDOLLARSTATS_SCRIPT_SRC, | |
| defer: true, |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const SITE_NAME = "osschat"; | ||
| const SITE_DESCRIPTION = "Open source AI chat with 350+ models. Access GPT-4, Claude, Gemini, and more through one beautiful interface. Free tier available, no API key required."; | ||
| const SITE_TAGLINE = "One interface. Every AI model."; | ||
| const ONEDOLLARSTATS_SCRIPT_SRC = "https://assets.onedollarstats.com/stonks.js"; |
There was a problem hiding this comment.
PR description claims ONEDOLLARSTATS_SCRIPT_INTEGRITY was also extracted — it wasn't
The PR summary states:
expose the OneDollarStats script URL and integrity hash as constants
And the auto-generated cubic summary echoes:
extracting
ONEDOLLARSTATS_SCRIPT_SRCandONEDOLLARSTATS_SCRIPT_INTEGRITYconstants
However, the diff only adds ONEDOLLARSTATS_SCRIPT_SRC. The integrity attribute was removed entirely rather than being extracted to a named constant. If the intent was truly to make the hash easy to update in one place, the constant should have been created and wired back in — otherwise the description misrepresents the change.
If the intent was to drop SRI entirely (a valid decision, discussed in the previous thread), the PR description should be updated to reflect that.
Confidence: 3/5 — the description / code mismatch is real, but the behaviour itself (removing SRI) may be intentional even if the words say otherwise.
Summary
PORTLESS_NAMEinterpolationTesting
Summary by cubic
Fixes OneDollarStats tracking by updating the SRI hash and extracting
ONEDOLLARSTATS_SCRIPT_SRCandONEDOLLARSTATS_SCRIPT_INTEGRITYconstants in__root.tsxso browsers don’t block analytics. Also restores the configurable dev script inapps/web/package.json(keepsPORTLESS_NAMEsupport).Written for commit 13efa21. Summary will update on new commits.
Note
Remove Subresource Integrity check from OneDollarStats analytics script
Extracts the analytics script URL into a
ONEDOLLARSTATS_SCRIPT_SRCconstant in __root.tsx and removes theintegrityattribute from the script tag. Risk: browsers will no longer enforce SRI for this script, meaning any changes to the remote script will load without hash verification.Macroscope summarized d9764d7.