Skip to content

fix: show deploy banner only on new contract deployment#1624

Open
PratikshaGayen wants to merge 1 commit into
genlayerlabs:mainfrom
PratikshaGayen:fix/duplicate-deploy-banner
Open

fix: show deploy banner only on new contract deployment#1624
PratikshaGayen wants to merge 1 commit into
genlayerlabs:mainfrom
PratikshaGayen:fix/duplicate-deploy-banner

Conversation

@PratikshaGayen
Copy link
Copy Markdown

@PratikshaGayen PratikshaGayen commented May 10, 2026

Fixes #628

The deploy banner was showing up multiple times when deploying a contract.

The issue was in addDeployedContract() in frontend/src/stores/contracts.ts
notify() was being called unconditionally after the if/else block, so it fired
whether the contract was new or just being redeployed.

Moved notify() inside the if (index === -1) branch so it only triggers
on a fresh deployment.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed duplicate "Contract deployed" notifications. The notification now displays only when a new contract is deployed, not when updating existing contract records.

Review Change Stack

Previously, notify() was called unconditionally in addDeployedContract(),
causing the banner to appear multiple times when a contract was redeployed
or the function was called more than once for the same contract.

Now the notification is only triggered when index === -1, i.e. when it is
a genuinely new deployment.

Fixes genlayerlabs#628
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1bf8b2e9-e8ae-4a7d-a7b8-e796a7cc34ae

📥 Commits

Reviewing files that changed from the base of the PR and between 6736a15 and 9c4efa0.

📒 Files selected for processing (1)
  • frontend/src/stores/contracts.ts

📝 Walkthrough

Walkthrough

The change modifies addDeployedContract to conditionally emit the "Contract deployed" success notification. The notification now triggers only when inserting a new contract record, not when updating an existing one, preventing duplicate notifications for the same contract.

Changes

Deployment Success Notification

Layer / File(s) Summary
Notification Conditional Logic
frontend/src/stores/contracts.ts
The success notification is moved inside the insert branch (index === -1) so it fires only for new contract records, not for updates to existing records.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A banner once danced every time,
Announcing contracts in prime,
But duplicates swirled in the air—
Now new ones alone get the fanfare! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: show deploy banner only on new contract deployment' accurately and specifically describes the main change in the PR.
Description check ✅ Passed The PR description covers the issue reference, what was changed, why it was changed, and the root cause, but lacks testing details and release notes as specified in the template.
Linked Issues check ✅ Passed The PR successfully addresses issue #628 by moving the notify() call to only trigger on new deployments, directly fixing the duplicate banner problem.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the duplicate deploy banner issue in addDeployedContract() with no out-of-scope modifications.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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.

FE-Contract deploy banner is repeated multiple times when deploying IC

1 participant