Skip to content

bug: small bugfixes for likes - #897

Merged
danielroe merged 1 commit into
npmx-dev:mainfrom
fatfingers23:bug/like-logic-fixes
Feb 4, 2026
Merged

bug: small bugfixes for likes#897
danielroe merged 1 commit into
npmx-dev:mainfrom
fatfingers23:bug/like-logic-fixes

Conversation

@fatfingers23

Copy link
Copy Markdown
Member

I think there may still be a few to be worked out. But this should be a start

  • Fixed a bug on always adding a like if it wasn't from the cache, not if it was found in the cache which is the case atm
  • Always set the cache as unlike on the post to help with any miss matches

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentFeb 3, 2026 11:43pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewFeb 3, 2026 11:43pm
npmx-lunariaIgnoredIgnoredFeb 3, 2026 11:43pm

Request Review

@codecov

codecovBot commented Feb 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This change introduces cache synchronisation improvements for like and unlike operations. A new public method setUnlikeInCache is added to update the user-like status in cache to false. The like delete endpoint now calls this method when no existing like record is found, ensuring cache consistency regardless of database state. Additionally, the cache update logic in likeAPackageAndReturnLikes is modified to persist totalLikes after computing it from network data. The unlike operation is refactored to use the new method instead of directly setting cache values.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check nameStatusExplanation
Description check✅ PassedThe pull request description clearly relates to the changeset, describing bug fixes for like/unlike logic and cache synchronization.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe
danielroe added this pull request to the merge queueFeb 4, 2026
Merged via the queue into npmx-dev:main with commit 05483f5Feb 4, 2026
15 of 17 checks passed
@fatfingers23
fatfingers23 deleted the bug/like-logic-fixes branch February 5, 2026 02:04
Sign up for freeto 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

@fatfingers23@danielroe