Skip to content

fix(search): fake commit to trigger linked deployment#7228

Open
rmelisson wants to merge 1 commit intodevfrom
linked-suggestions
Open

fix(search): fake commit to trigger linked deployment#7228
rmelisson wants to merge 1 commit intodevfrom
linked-suggestions

Conversation

@rmelisson
Copy link
Copy Markdown
Contributor

No description provided.

@revu-bot revu-bot bot requested a review from revu-bot April 10, 2026 07:56
@rmelisson rmelisson temporarily deployed to build-review-auto April 10, 2026 07:56 — with GitHub Actions Inactive
Copy link
Copy Markdown
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

Review Summary

This PR contains two changes: a default parameter bump (size: 5 → 8) and a debug console.log left in production code. The PR title ("fake commit to trigger linked deployment") is itself a red flag — it signals the change was not made for a legitimate functional reason.

File Lines Severity Issue
src/api/modules/suggest/service.ts 14 CRITICAL console.log debug statement left in production code
src/api/modules/suggest/service.ts 6 IMPORTANT Undocumented/unjustified default size change (5 → 8)

Comment on lines +13 to 16

console.log(JSON.stringify(body, null, 2));

return response.hits.hits.map((t) => t._source.title);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[CRITICAL] Debug console.log must not reach production

  • Why it matters: This logs the full Elasticsearch query body on every suggestion request. In production this will:
    • Flood server logs with high-volume noise (one log per keystroke per user).
    • Potentially expose internal query structure / index configuration in log aggregation systems.
    • Degrade performance under load due to JSON.stringify on every call.
  • Fix: Remove the statement entirely before merging.
Suggested change
console.log(JSON.stringify(body, null, 2));
return response.hits.hits.map((t) => t._source.title);
return response.hits.hits.map((t) => t._source.title);

const minQueryLength = 2;

export const getSuggestions = async (q: string, size = 5) => {
export const getSuggestions = async (q: string, size = 8) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[IMPORTANT] Undocumented change to default size (5 → 8)

  • Why it matters: The default suggestion count is a product/UX decision that affects perceived search quality and Elasticsearch load. Changing it silently (and in a commit explicitly described as a "fake commit") makes it impossible to audit or revert intentionally.
  • Actions required:
    1. If this change is intentional, document the rationale in a code comment or PR description and add/update tests that assert the new default.
    2. If it was accidental, revert to 5.
Suggested change
export const getSuggestions = async (q: string, size = 8) => {
export const getSuggestions = async (q: string, size = 5) => {

@sonarqubecloud
Copy link
Copy Markdown

@tokenbureau
Copy link
Copy Markdown

tokenbureau bot commented Apr 10, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants