Skip to content

Fix points transfer#669

Merged
feruzm merged 3 commits into
developfrom
point
Feb 22, 2026
Merged

Fix points transfer#669
feruzm merged 3 commits into
developfrom
point

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Feb 22, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed point transfer responses to use the correct unit denomination.
  • Improvements

    • Follow/unfollow actions now update follower/following counts immediately so UI reflects changes faster.
    • Trending tags list now refreshes hourly for more up-to-date results.
    • Error messaging updated to refer to "Favourites" consistently.
  • Chores

    • Package versions and changelogs updated.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 22, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Minor SDK updates: normalize POINTS→POINT in Ecency point-transfer op; adjust cache keys/invalidation for favourites, relations, follow/unfollow; reduce trending-tags query staleTime to 1 hour; bump package versions and changelogs.

Changes

Cohort / File(s) Summary
Ecency operations
packages/sdk/src/modules/operations/builders/ecency.ts
Normalize amount in buildPointTransferOp by replacing "POINTS" with "POINT" before emitting the operation JSON.
Account favourites
packages/sdk/src/modules/accounts/mutations/favourites/use-account-favourite-add.ts, packages/sdk/src/modules/accounts/mutations/favourites/use-account-favourite-delete.ts
Update auth-missing error text to reference "Favourites" instead of "Bookmarks"; change mutation cache key for delete to include "delete".
Account relations & follow/unfollow
packages/sdk/src/modules/accounts/mutations/use-account-relations-update.ts, packages/sdk/src/modules/accounts/mutations/use-follow.ts, packages/sdk/src/modules/accounts/mutations/use-unfollow.ts
Use QueryKeys helper for relations cache updates; expand cache invalidation to include QueryKeys.accounts.followCount(...) for affected accounts.
Posts queries
packages/sdk/src/modules/posts/queries/get-trending-tags-query-options.ts
Change staleTime from Infinity to 60 * 60 * 1000 (1 hour) to enable periodic refetch.
Package metadata & changelogs
packages/sdk/CHANGELOG.md, packages/sdk/package.json, packages/wallets/CHANGELOG.md, packages/wallets/package.json
Bump SDK and wallets package versions and add changelog entries reflecting the patch release and dependency update.

Sequence Diagram(s)

(Skipped — changes are small, localized, and do not introduce a new multi-component control flow that benefits from a sequence diagram.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Fix points transfer #669 — Fixes POINTS→POINT normalization in Ecency op builder and aligns with SDK updates in this PR.

Suggested labels

patch:sdk

Poem

🐰 A tiny hop, I fixed a dot,
POINTS to POINT — a cleaner spot.
Caches nudged and tags refreshed,
Versions bumped, the code feels blessed. ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix points transfer' is related to the main change (normalization of amount in buildPointTransferOp), but is vague and doesn't clearly describe what the fix entails or what problem is being solved. Consider a more descriptive title like 'Normalize points in buildPointTransferOp' or 'Fix points transfer amount normalization' to clarify the specific nature of the fix.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch point

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/sdk/src/modules/operations/builders/ecency.ts (1)

149-150: Optional: prefer replaceAll (or add the g flag) for completeness.

String.prototype.replace with a non-global regex replaces only the first match. For a well-formed amount like "1.000 POINTS" there is at most one occurrence, so this is not a bug today. However, using replaceAll is slightly more defensive and communicates intent more clearly:

♻️ Suggested simplification
-  const normalizedAmount = amount.replace(/POINTS\b/, "POINT");
+  const normalizedAmount = amount.replaceAll("POINTS", "POINT");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sdk/src/modules/operations/builders/ecency.ts` around lines 149 -
150, The normalization currently uses amount.replace(/POINTS\b/, "POINT") which
only replaces the first match; update the normalization for normalizedAmount in
the ecency builder to be global/explicit by using either
amount.replaceAll("POINTS", "POINT") or amount.replace(/POINTS\b/g, "POINT") so
all occurrences are normalized and intent is clear (reference: normalizedAmount
variable in packages/sdk/src/modules/operations/builders/ecency.ts).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/sdk/src/modules/operations/builders/ecency.ts`:
- Around line 149-150: The normalization currently uses
amount.replace(/POINTS\b/, "POINT") which only replaces the first match; update
the normalization for normalizedAmount in the ecency builder to be
global/explicit by using either amount.replaceAll("POINTS", "POINT") or
amount.replace(/POINTS\b/g, "POINT") so all occurrences are normalized and
intent is clear (reference: normalizedAmount variable in
packages/sdk/src/modules/operations/builders/ecency.ts).

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Feb 22, 2026
@feruzm feruzm merged commit 89637f0 into develop Feb 22, 2026
@feruzm feruzm deleted the point branch February 22, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant