Skip to content

Fix points activities#3106

Merged
feruzm merged 3 commits intodevelopmentfrom
point
Jan 30, 2026
Merged

Fix points activities#3106
feruzm merged 3 commits intodevelopmentfrom
point

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Jan 30, 2026

Summary by CodeRabbit

  • New Features

    • Added "points" as a first-class data source for activities and assets, including tailored mapping and loading behavior.
  • Chores

    • Removed development-time console logging across the app.
    • Adjusted activities pagination/refresh behavior for the points layer (no pagination; explicit refresh handling).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Removes development console logs across several files and integrates a POINTS data path into wallet queries, adding pointsQuery usage and branching in activities/refresh/pagination logic while grooming POINTS transactions for UI consumption. (49 words)

Changes

Cohort / File(s) Summary
Development Logging Removal
src/containers/pointsContainer.ts, src/screens/assetDetails/screen/assetDetailsScreen.tsx, src/screens/wallet/screen/walletScreen.tsx
Removed development-time console.log/debug statements across container and screen components.
Query Return Refactor
src/providers/queries/pointQueries.ts
Adjusted useGetPointsQuery to assign useQuery result to a local queryResult constant and return it (no behavioral change).
POINTS Layer Integration
src/providers/queries/walletQueries/walletQueries.ts
Added imports for getPointsQueryOptions, POINTS, and groomingPointsTransactionData; introduced pointsQuery and POINTS-specific data mapping in useActivitiesQuery; branched _refresh and _fetchNextPage to handle POINTS (no pagination for POINTS); removed dev logs from related hooks (useAssetsQuery, useClaimRewardsMutation).

Sequence Diagram(s)

sequenceDiagram
    participant UI as Client/UI
    participant WalletQ as WalletQueries
    participant PointsSvc as POINTS Query (SDK)
    participant Engine as Engine/Chain Query
    participant DB as Local State (balance/userActivities)

    UI->>WalletQ: request activities (layer)
    alt layer == "points"
        WalletQ->>PointsSvc: fetch points transactions
        PointsSvc-->>WalletQ: points data
        WalletQ->>WalletQ: groomingPointsTransactionData(map with POINTS metadata)
    else layer == "engine/chain"
        WalletQ->>Engine: fetch engine/chain transactions
        Engine-->>WalletQ: transactions
        WalletQ->>WalletQ: existing grooming flow
    end
    WalletQ->>DB: update balance, userPoints, userActivities
    DB-->>UI: updated activities/balance
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I nibble logs that clutter the trail,
POINTS hop in with a tidy new trail,
Groomed bits and branches align,
Balance and activity hop in time,
A rabbit's cheer for code made fine 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix points activities' directly reflects the main change: fixing points-related activity handling across multiple files in the codebase, including new POINTS data flow integration and bug fixes in containers and screens.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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
  • 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

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/providers/queries/walletQueries/walletQueries.ts`:
- Around line 353-364: When mapping POINTS transactions in the points branch
(use pointsQuery.data?.transactions), ensure you fall back to POINTS.default for
unknown item.type values so required fields aren't undefined; update the three
lookups used for the groomingPointsTransactionData call (icon, iconType,
textKey) to use POINTS[get(item, 'type')] || POINTS.default. Apply the same
fallback pattern in pointsContainer.ts for the equivalent lookups (the ones on
lines around the pointsContainer mapping) so both places always supply string
values for icon, iconType and textKey.
🧹 Nitpick comments (1)
src/providers/queries/walletQueries/walletQueries.ts (1)

297-301: Consider reusing useGetPointsQuery to avoid duplication.

This query duplicates the logic in useGetPointsQuery from pointQueries.ts, which also wraps getPointsQueryOptions. While both will share the same React Query cache (same query key), consolidating to a single hook would improve maintainability.

♻️ Suggested refactor

Import and use the existing hook instead:

+import { useGetPointsQuery } from '../pointQueries';

Then replace the inline query:

-  // For POINTS, use SDK points query to get activities from Ecency API
-  const pointsQuery = useQuery({
-    ...getPointsQueryOptions(username, 0),
-    enabled: !!username && isPoints,
-  });
+  // For POINTS, use SDK points query to get activities from Ecency API
+  const pointsQuery = useGetPointsQuery(isPoints ? username : undefined, 0);

Note: This would require adjusting useGetPointsQuery to accept undefined as username (which it already does based on its signature).

Comment thread src/providers/queries/walletQueries/walletQueries.ts
@feruzm feruzm merged commit 9655b18 into development Jan 30, 2026
1 of 3 checks passed
@feruzm feruzm deleted the point branch January 30, 2026 06:12
@coderabbitai coderabbitai Bot mentioned this pull request Mar 2, 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.

1 participant