Skip to content

fix(contract): persist campaign tags on-chain - #892

Open
Rafiat30 wants to merge 3 commits into
Iris-IV:mainfrom
Rafiat30:fix/create-campaign-tags-persistence
Open

fix(contract): persist campaign tags on-chain#892
Rafiat30 wants to merge 3 commits into
Iris-IV:mainfrom
Rafiat30:fix/create-campaign-tags-persistence

Conversation

@Rafiat30

@Rafiat30 Rafiat30 commented Jul 30, 2026

Copy link
Copy Markdown

Closes #558

Summary

createCampaign() in src/lib/contractClient.ts accepts a tags: string[] parameter and uses it on the mock code path, but on the real (non-mock) Stellar contract call it is never sent as a contract argument and never encoded into the description's off-chain POH_EXT blob (unlike coverImageUrl/milestones, which already use that mechanism). Tags are silently dropped for real campaigns, even though decodeCampaign() expects to read a tags field back on read.

Changes

  • Modified: src/lib/contractClient.ts — added a TODO(#558) comment directly above createCampaign() documenting the exact bug (tags accepted as a parameter, dropped on the non-mock path) so the fix location is unambiguous for whoever picks this up next.

Why

This surfaces and pins down the root cause precisely (contract-call path vs. off-chain description encoding vs. mock path) ahead of the full fix, which will extend the existing POH_EXT off-chain encoding pattern to include tags, and update decodeCampaign() to parse them back out.

Tests

No behavioral change in this PR — comment-only. The full fix (tracked under this same issue) will include:

  • A decodeCampaign round-trip test asserting tags survive encode/decode via the off-chain blob.
  • A createCampaign test asserting tags are no longer dropped on the non-mock path.

How to test

  • npm run typecheck — confirms no regressions from the comment addition.

Rafiat30 added 2 commits July 30, 2026 11:51
Implementation to follow. Tracks the createCampaign() bug where the
tags parameter is silently dropped on the non-mock contract-call path.

Refs Iris-IV#558
@sshdopey

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

createCampaign() accepted tags but never sent them to the real (non-mock)
contract call and never encoded them into the off-chain POH_EXT description
blob the way coverImageUrl/milestones already are — so tags were silently
dropped for every real campaign. decodeCampaign() then read tags from
fields["tags"], a contract field that never exists per the actual
CreateCampaignParams schema (creator, title, description, funding_goal,
duration_days, category, has_revenue_sharing, revenue_share_percentage,
max_contribution_per_user), so tags always decoded to [] for real campaigns.

Encodes tags into the existing POH_EXT blob in createCampaign() and parses
them back out in decodeCampaign(), falling back to the contract field only
for older/mock records. Also fixes the shared contractClient.test.ts mock's
getAccount() return value, which was missing sequenceNumber() and silently
broke every non-mock mutation test (including the pre-existing "non-mock
branch runs core read/write flows" test).

Refs Iris-IV#558
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Rafiat30 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@sshdopey

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

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.

[Bug] NewCauseClient sends tags/milestones/coverImageUrl to createCampaign — these fields don't exist in contract params

2 participants