Skip to content

feat(contract): add no-show timeout refund flow#176

Merged
Luluameh merged 1 commit into
LightForgeHub:mainfrom
Chucks1093:feat/close-166-168-169-170
Apr 28, 2026
Merged

feat(contract): add no-show timeout refund flow#176
Luluameh merged 1 commit into
LightForgeHub:mainfrom
Chucks1093:feat/close-166-168-169-170

Conversation

@Chucks1093
Copy link
Copy Markdown
Contributor

@Chucks1093 Chucks1093 commented Apr 28, 2026

Summary

  • add claim_no_show_refund(seeker, session_id) to support seeker refunds when expert no-shows
  • enforce eligibility checks: seeker-only caller, active session, timeout passed (10 minutes), and no settlement activity
  • transfer full remaining escrow back to seeker and mark session completed
  • emit a dedicated no-show refund event for indexer visibility
  • add tests for successful timeout refund and pre-timeout rejection

Validation

  • cargo test -q (blocked by existing unrelated compile/type errors already present in repository)

Closes #166
Closes #168
Closes #169
Closes #170

Summary by CodeRabbit

  • New Features

    • Added no-show refund claim functionality that allows session seekers to claim full refunds if sessions remain unused within a 10-minute grace period following the scheduled start time, provided no streaming activity has occurred.
  • Bug Fixes

    • Fixed minor formatting issue in the codebase.
  • Tests

    • Added comprehensive unit tests covering refund claim scenarios and edge cases.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d20793b3-f033-4561-b463-c4021b0e1acf

📥 Commits

Reviewing files that changed from the base of the PR and between 005d459 and e57103c.

📒 Files selected for processing (1)
  • contracts/src/lib.rs

📝 Walkthrough

Walkthrough

Adds a new claim_no_show_refund public method to the contract that enables session seekers to claim full refunds from sessions where experts failed to join within a 10-minute timeout window. The method validates session state, timing constraints, and no-streaming conditions before processing the refund transfer, updating session status, and emitting an event.

Changes

Cohort / File(s) Summary
Session No-Show Refund
contracts/src/lib.rs
Added claim_no_show_refund public method with 10-minute timeout validation, balance transfer to seeker, session completion logic, and event emission. Includes two unit tests covering successful post-timeout refund and pre-timeout failure scenarios. Fixed missing trailing newline.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 A seeker sits alone, no expert shows,
Ten minutes pass, the silence grows,
But fear not! A refund flows back fast,
No more waiting, balance restored at last! 💸
The expert's absence? Now it's their loss,
Fair is fair, or so sayeth the boss! ✨

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

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.

@Luluameh Luluameh merged commit 9921b20 into LightForgeHub:main Apr 28, 2026
1 check was pending
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.

Implement Protocol Upgrade Mechanism Event Payload Optimization Emit Rich Events for Subgraphs/Indexers Auto-Refund on Expert No-Show

2 participants