Skip to content

Review me - #157

Open
milangit wants to merge 8 commits into
mate-academy:mainfrom
milangit:review-me
Open

Review me#157
milangit wants to merge 8 commits into
mate-academy:mainfrom
milangit:review-me

Conversation

@milangit

Copy link
Copy Markdown

No description provided.

@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

The implementation successfully covers all required core features (add, list, search, delete) as specified in the task requirements. However, there is a critical bug in lib/store.js where the edit() function will crash with a TypeError: Cannot set properties of undefined when attempting to edit a non-existent note ID. The data.notes.find() can return undefined for invalid IDs, but the code doesn't guard against this before executing note.text = text. Additionally, notes.js (lines 42-47) should check the return value from store.edit() and print an error message similar to how delete handles non-existent notes, rather than silently failing. These issues must be fixed before approval as they represent broken functionality that would crash the application.

To fix: Add a guard in lib/store.js edit function:

const note = data.notes.find(n => n.id === id);
if (!note) return false;
note.text = text;

And update notes.js edit case to handle the false return value with an appropriate error message.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread lib/store.js
Comment thread .gitignore
Comment thread notes.js Outdated
@milangit

Copy link
Copy Markdown
Author

Claude had found the bug regarding id

@milangit

Copy link
Copy Markdown
Author

Claude had found the bug regarding id

@milangit milangit closed this Aug 29, 2026
@milangit milangit reopened this Aug 29, 2026
store.edit() now returns false instead of crashing when the id
doesn't match a note; notes.js reports "No note #<id> found" like
delete does.

@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 is approved. All required features are correctly implemented: the edit() function in lib/store.js now properly guards against non-existent note IDs with the check at line 51 (if (!note) return false;), and notes.js correctly handles the return value with appropriate error messaging at line 46. All core commands (add, list, search, delete, edit) work as specified. Great job fixing the bugs that were identified in the previous review — your attention to edge cases like editing non-existent notes shows solid problem-solving skills. Keep up the excellent work!


✨ 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.

3 participants