Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ app.use(express.urlencoded({ extended: true }));

app.use('/generated-pdfs', express.static(path.resolve(config.pdf.storagePath)));

const { crSmokeModuleMarker } = require('./utils/reviewFlowSmoke');
app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});

app.use('/api', routes);

app.get('/smoke', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString(), marker: crSmokeModuleMarker() });
});

app.use(notFoundHandler);
app.use(errorHandler);

Expand Down
6 changes: 6 additions & 0 deletions backend/src/utils/reviewFlowSmoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ function crSmokeClickUpVerify(expected, actual) {
return expected == actual;
}

function demoClampHistoryLimit(limit) {
const value = Number(limit);
if (!Number.isFinite(value)) return 0;
return Math.min(Math.max(value, 0), 100);
}
Comment on lines +52 to +56

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.


module.exports = {
resolveListenPortDemo,
normalizeNumberDemo,
Expand Down
Loading