Skip to content

docs: removeOrder3 emits RemoveOrderV3 only on state change#62

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-06-10-issue-2669
Open

docs: removeOrder3 emits RemoveOrderV3 only on state change#62
thedavidmeister wants to merge 1 commit into
mainfrom
2026-06-10-issue-2669

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

What

Doc-only fix to the removeOrder3 NatSpec in IRaindexV6.sol. This is
the authoritative source consumed via @inheritdoc by the raindex
implementation.

Why

The prose said removing an order multiple times or removing one that
never existed is valid and "the event will be emitted". That
unconditional claim contradicts the @return stateChanged doc on the
same function ("false if it did not exist") and the actual code, which
guards the RemoveOrderV3 emit (and post tasks) behind a live-order
check: a dead / never-existing removal is a no-op that returns false and
emits nothing.

Per the maintainer decision on rainlanguage/raindex#2669 ("emit events
when there is a state change; update the docs to match the code"), this
reconciles the prose with the no-op semantics:

  • A live order removal MUST change state, emit RemoveOrderV3, and
    return true.
  • A not-live (already-dead / never-existing) removal MUST NOT change
    state or emit an event, and returns false.

This mirrors the symmetric addOrder4 spec a few lines above. The
@return stateChanged doc is unchanged and now consistent with the
prose. Deprecated v1-v4 interfaces are intentionally left untouched.

Testing

Doc-only change. forge build succeeds and forge fmt --check is
clean. A NatSpec comment has no observable runtime behavior and this
interface-only package has no test harness or doc-gen in CI, so there is
no compiled artifact a test could assert against; no behavioral test is
applicable.

Resolves rainlanguage/raindex#2669

🤖 Generated with Claude Code

The removeOrder3 NatSpec said the event "will be emitted" for every
call, including redundant or never-existing removals. That contradicts
the @return stateChanged doc, which returns false when the order did not
exist. Reconcile the prose with the no-op semantics: a RemoveOrderV3
event is emitted, and state changes, only when a live order is actually
removed; an already-dead or never-existing removal is a no-op that
returns false. This mirrors the addOrder4 spec.

Closes #2669

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 14 minutes and 26 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1c993e63-13b9-4405-9178-754041943d18

📥 Commits

Reviewing files that changed from the base of the PR and between a85c690 and c4e64f8.

📒 Files selected for processing (1)
  • src/interface/IRaindexV6.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-10-issue-2669

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.

removeOrder3 emits no RemoveOrderV3 on dead/redundant removal despite NatSpec 'the event will be emitted'

1 participant