Skip to content

SDK fix activity#684

Merged
feruzm merged 3 commits intodevelopfrom
act
Feb 28, 2026
Merged

SDK fix activity#684
feruzm merged 3 commits intodevelopfrom
act

Conversation

@feruzm
Copy link
Member

@feruzm feruzm commented Feb 28, 2026

Summary by CodeRabbit

  • Refactor
    • Made block number optional for activity tracking; activity recording now proceeds when block number is absent, improving post-broadcast consistency.
  • Bug Fixes
    • Fixed SDK activity recording behavior to handle reordered/optional parameters without breaking error handling.
  • Chores
    • Bumped SDK and Wallet package versions and updated changelogs.

@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 28, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 203576f and d1f24fa.

⛔ Files ignored due to path filters (7)
  • packages/sdk/dist/browser/index.d.ts is excluded by !**/dist/**
  • packages/sdk/dist/browser/index.js is excluded by !**/dist/**
  • packages/sdk/dist/browser/index.js.map is excluded by !**/dist/**, !**/*.map
  • packages/sdk/dist/node/index.cjs is excluded by !**/dist/**
  • packages/sdk/dist/node/index.cjs.map is excluded by !**/dist/**, !**/*.map
  • packages/sdk/dist/node/index.mjs is excluded by !**/dist/**
  • packages/sdk/dist/node/index.mjs.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (4)
  • packages/sdk/CHANGELOG.md
  • packages/sdk/package.json
  • packages/wallets/CHANGELOG.md
  • packages/wallets/package.json

📝 Walkthrough

Walkthrough

PlatformAdapter.recordActivity parameter order changed: blockNum moved to an optional third parameter. Web broadcast adapter and several post/proposal mutation hooks updated to call the new signature and to record activity when result.id is present even if block_num is absent.

Changes

Cohort / File(s) Summary
Type Definition
packages/sdk/src/modules/core/types/platform-adapter.ts
Changed recordActivity signature from (activityType, blockNum, txId) to (activityType, txId, blockNum?) (blockNum is now optional and third).
Adapter Implementation
apps/web/src/providers/sdk/web-broadcast-adapter.ts
Updated recordActivity public signature to recordActivity(activityType: number, txId: string, _blockNum?: number) and invoke internal usrActivity with undefined for blockNum.
Post/Proposal Mutations
packages/sdk/src/modules/posts/mutations/use-comment.ts, packages/sdk/src/modules/posts/mutations/use-reblog.ts, packages/sdk/src/modules/posts/mutations/use-update-reply.ts, packages/sdk/src/modules/posts/mutations/use-vote.ts, packages/sdk/src/modules/proposals/mutations/use-proposal-vote.ts
Relaxed guards to record activity when result.id exists (no longer require result.block_num); reordered recordActivity calls to pass txId/id as second argument and block_num (if any) as third; one location changed logging from console.error to console.debug.
Package metadata & changelogs
packages/sdk/CHANGELOG.md, packages/sdk/package.json, packages/wallets/CHANGELOG.md, packages/wallets/package.json
Bumped packages/sdk to 2.0.20 and packages/wallets to 1.5.48; added changelog entries noting SDK activity fix and wallet dependency update.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

patch:sdk

Poem

🐰 A hop and a tweak, parameters swapped with care,
IDs now lead the dance through code and air,
Block numbers optional, tucked softly away,
Activity logs hop forward, brightening the day. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'SDK fix activity' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes made to the activity recording system. Use a more specific title that describes the actual change, such as 'Reorder recordActivity parameters and make blockNum optional' or 'Make block number optional in activity recording'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.

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

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.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm removed 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 28, 2026
Copy link
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/src/providers/sdk/web-broadcast-adapter.ts (1)

281-292: ⚠️ Potential issue | 🟡 Minor

Pass _blockNum to usrActivity instead of hardcoded undefined.

The _blockNum parameter is received from the interface but always passed as undefined to usrActivity. Other calls in the codebase (e.g., apps/web/src/api/operations.ts) pass actual block numbers. Either use the parameter or remove it from the signature to avoid confusion.

Suggested change
-        await usrActivity(token, activityType, undefined, txId);
+        await usrActivity(token, activityType, _blockNum, txId);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/providers/sdk/web-broadcast-adapter.ts` around lines 281 - 292,
In recordActivity (web-broadcast-adapter.ts) you're ignoring the _blockNum
parameter and calling usrActivity(token, activityType, undefined, txId); change
the call to pass the received _blockNum (usrActivity(token, activityType,
_blockNum, txId)) so the actual block number is propagated, or if block numbers
are truly unused remove the _blockNum parameter from recordActivity's signature
and all callers; update references to the recordActivity function accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/web/src/providers/sdk/web-broadcast-adapter.ts`:
- Around line 281-292: In recordActivity (web-broadcast-adapter.ts) you're
ignoring the _blockNum parameter and calling usrActivity(token, activityType,
undefined, txId); change the call to pass the received _blockNum
(usrActivity(token, activityType, _blockNum, txId)) so the actual block number
is propagated, or if block numbers are truly unused remove the _blockNum
parameter from recordActivity's signature and all callers; update references to
the recordActivity function accordingly.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86b6479 and 203576f.

📒 Files selected for processing (7)
  • apps/web/src/providers/sdk/web-broadcast-adapter.ts
  • packages/sdk/src/modules/core/types/platform-adapter.ts
  • packages/sdk/src/modules/posts/mutations/use-comment.ts
  • packages/sdk/src/modules/posts/mutations/use-reblog.ts
  • packages/sdk/src/modules/posts/mutations/use-update-reply.ts
  • packages/sdk/src/modules/posts/mutations/use-vote.ts
  • packages/sdk/src/modules/proposals/mutations/use-proposal-vote.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/sdk/src/modules/posts/mutations/use-reblog.ts
  • packages/sdk/src/modules/posts/mutations/use-update-reply.ts
  • packages/sdk/src/modules/proposals/mutations/use-proposal-vote.ts
  • packages/sdk/src/modules/posts/mutations/use-comment.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 28, 2026
@feruzm feruzm merged commit a5f9337 into develop Feb 28, 2026
1 check was pending
@feruzm feruzm deleted the act branch February 28, 2026 17:42
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