issue fixed sfvgfdvb - #53
Conversation
📝 WalkthroughWalkthroughA ChangesSmoke Endpoint Registration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 8/10 reviews remaining, refill in 8 minutes and 39 seconds. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@backend/src/utils/reviewFlowSmoke.js`:
- Around line 52-56: The new helper demoClampHistoryLimit is defined but not
added to module.exports, so update the module's export object to include
demoClampHistoryLimit (and any other new helpers added in the 58-64 range) so
external callers can import them; locate the module.exports declaration in this
file and add demoClampHistoryLimit (and the other newly introduced helper names)
as properties.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5d3f9494-1408-4cec-9421-ea2944d203fa
📒 Files selected for processing (2)
backend/src/app.jsbackend/src/utils/reviewFlowSmoke.js
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
backend/src/**/*.{js,ts}
📄 CodeRabbit inference engine (Custom checks)
backend/src/**/*.{js,ts}: Backend source code must not contain hardcoded credentials, Shopify webhook secrets, or database passwords (must use env variables andconfig/env.jspatterns)
Backend webhook routes must not skip or weaken HMAC or Shopify authentication validation
Backend code must not build SQL queries by concatenating untrusted strings; must use parameterized queries or ORM usage
Backend async routes and services must implement proper error handling withnext(err)or structured error responses instead of swallowing errors
Files:
backend/src/utils/reviewFlowSmoke.jsbackend/src/app.js
**/*.{js,mjs,cjs,ts,tsx,jsx,vue}
📄 CodeRabbit inference engine (.cursor/rules/README.md)
**/*.{js,mjs,cjs,ts,tsx,jsx,vue}: Follow JS/TS language rules: modules, async patterns, TypeScript usage, error handling, and platform considerations
Follow JavaScript/TypeScript architectural patterns: structure, async flow, React habits, and anti-pattern avoidance
Files:
backend/src/utils/reviewFlowSmoke.jsbackend/src/app.js
backend/src/**/*.js
⚙️ CodeRabbit configuration file
backend/src/**/*.js: This path is the Node.js + Express API, MySQL access, Shopify webhooks, PDF/print services, and Socket.IO server for OMA. Blocking rules for changed lines:
- Configuration must come from
backend/src/config/env.jsand environment variables—do not hardcode DB passwords, Shopify secrets, or deployment-specific hosts in source.- Webhook and HMAC-sensitive routes must remain protected by the existing Shopify auth middleware (
shopifyAuth/ HMAC validation); do not bypass verification for convenience.- Async route handlers and services must propagate errors to Express (
next(err)or throw into async wrappers) or handle them explicitly—no emptycatchblocks that hide failures.- Database access must use parameterized queries / the existing models layer—no string-concatenated SQL with user-controlled input.
- New Socket.IO handlers must handle errors and avoid leaking internal stack traces to clients in production.
- No new dependencies on
eval,child_processwith untrusted input, or disabling security middleware without strong justification.- Prefer
backend/src/services/for business logic and keep controllers thin; avoid duplicating rule/PDF/print orchestration across files.If any of the above appears in the diff for this path, you MUST request changes and explain the fix.
Files:
backend/src/utils/reviewFlowSmoke.jsbackend/src/app.js
🔇 Additional comments (1)
backend/src/app.js (1)
27-27: /smoke endpoint wiring looks good.Import and route response shape are clean and consistent with the smoke-check objective.
Also applies to: 34-36
| function demoClampHistoryLimit(limit) { | ||
| const value = Number(limit); | ||
| if (!Number.isFinite(value)) return 0; | ||
| return Math.min(Math.max(value, 0), 100); | ||
| } |
There was a problem hiding this comment.
New helper is not export-wired, so it cannot be consumed externally.
demoClampHistoryLimit is added but omitted from module.exports, so callers importing this module cannot use it.
Proposed fix
module.exports = {
resolveListenPortDemo,
normalizeNumberDemo,
demoFivexxPayload,
crSmokeModuleMarker,
crSmokeClickUpVerify,
+ demoClampHistoryLimit,
};Also applies to: 58-64
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@backend/src/utils/reviewFlowSmoke.js` around lines 52 - 56, The new helper
demoClampHistoryLimit is defined but not added to module.exports, so update the
module's export object to include demoClampHistoryLimit (and any other new
helpers added in the 58-64 range) so external callers can import them; locate
the module.exports declaration in this file and add demoClampHistoryLimit (and
the other newly introduced helper names) as properties.
Summary by CodeRabbit