Skip to content

Fix search substring match - #319

Open
mitret0 wants to merge 2 commits into
mate-academy:mainfrom
mitret0:fix-search-substring-match
Open

mitret0 wants to merge 2 commits into
mate-academy:mainfrom
mitret0:fix-search-substring-match

Conversation

@mitret0

@mitret0 mitret0 commented Oct 21, 2026

Copy link
Copy Markdown

No description provided.

Dimitar Dimitrov and others added 2 commits October 21, 2026 17:15
The matches() helper compared note text with strict equality, so
`notes.js search <term>` only returned notes whose text was exactly the
term. Use String.prototype.includes so any note containing the term is
returned, as documented. This fixes the two failing search tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Record the quick commit message written by hand before asking Claude,
so the two can be compared for the Lesson 2 exercise.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution correctly implements the required fix. The matches function in lib/store.js now uses .includes(term) to perform partial text matching, which resolves the original bug where only exact matches were returned. All CRUD operations (add, list, delete, search) are properly implemented and working as expected. The commit message is present in notes.md. The implementation meets all checklist requirements for the task.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example ↩

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