Skip to content

fix(revit): scope the PushButtonData release with a using on the IDisposable view - #712

Merged
thewrz merged 1 commit into
mainfrom
fix/revit-dispose-using-cast
Oct 6, 2026
Merged

thewrz merged 1 commit into
mainfrom
fix/revit-dispose-using-cast

Conversation

@thewrz

@thewrz thewrz commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This was written agentically; verify its assertions:

Why

#711 released PushButtonData in a finally block to satisfy cs/local-not-disposed on every leg; the rescan then raised code-quality finding #7 (cs/missed-using-statement), which prefers a using statement over manual disposal in finally. A plain using var on the PushButtonData cannot compile on the Revit 2024 leg, where the type is not IDisposable.

What

using var releaseButtonData = buttonData as IDisposable; right after construction: null (a no-op) on Revit 2024, a release at scope exit on 2025+, one code path for all legs, and the using form both queries accept. No #if, no finally.

Testing

  • All three legs compile with the CI commands against the real Revit API reference assemblies (2024 / 2025 / 2027)
  • CI green; code-quality finding feat(db): migration runner and core schema #7 closes on the next scan of main with no replacement
  • Manual: ribbon tab + Health Check button still appear in Revit (Windows + Revit only)

🤖 Co-authored by Claude Fable 5.1.

🤖 Generated with Claude Code

…posable view

The finally-block dispose (#711) satisfied cs/local-not-disposed but
tripped cs/missed-using-statement (code-quality finding #7). A `using`
on `buttonData as IDisposable` keeps one code path for all legs — null,
so a no-op, on Revit 2024 where the type is not disposable; a release at
scope exit on Revit 2025+ — and is the form both queries accept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: afaf99b4-e692-40fa-84ea-acfe42370990

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@thewrz
thewrz marked this pull request as ready for review October 6, 2026 23:14
@thewrz
thewrz merged commit 098c59c into main Oct 6, 2026
9 checks passed
@thewrz
thewrz deleted the fix/revit-dispose-using-cast branch October 6, 2026 23:14
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.

1 participant