Skip to content

docs: explain LockTable in table triggers and the convert-or-delete choice for LC0031 - #185

Merged
Arthurvdv merged 2 commits into
mainfrom
docs/lc0031-locktable-in-triggers
Sep 13, 2026
Merged

Arthurvdv merged 2 commits into
mainfrom
docs/lc0031-locktable-in-triggers

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

  • Rewrite the LC0031 page with the mechanism-first voice and Microsoft Learn blockquotes
  • Add Convert or delete section explaining BCQuality's criterion for when to convert vs delete a LockTable() call
  • Add LockTable in table triggers section answering the reporter's question from [Bug]: LC0031 - LockTable still used in table triggers Analyzers#530, with two Base App corpus shapes (dead lock, live lock)
  • Add Code fix section documenting the bare-self fix and the dropped-arguments limitation

Related: ALCops/Analyzers#530

🤖 Generated with Claude Code

…hoice for LC0031

Rewrite the LC0031 page with the mechanism-first voice: why LockTable
is transaction-wide, what ReadIsolation changes, and how tri-state
locking falls back. Add Convert or delete (BCQuality criterion),
LockTable in table triggers (the reporter's question), and Code fix
sections. Add Microsoft Learn blockquotes and BCQuality/Mads Gram
references.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…mple pairs

Point the BCQuality references at the microsoft/BCQuality knowledge
folder, give both trigger shapes a bad and a fixed example with the
standard diagnostic comment, and fix the highlighted lines.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Arthurvdv
Arthurvdv merged commit 33452e1 into main Sep 13, 2026
1 check passed
@Arthurvdv
Arthurvdv deleted the docs/lc0031-locktable-in-triggers branch September 13, 2026 09:45
Arthurvdv added a commit to ALCops/Analyzers that referenced this pull request Sep 13, 2026
…eiver forms (#547)

Issue #530 reported LC0031 firing on bare LockTable() inside Base App table
triggers and a code action that changed nothing there. The trigger case is
reported on purpose: the compiler binds every receiver form to the same
built-in, LockTable is transaction-wide while ReadIsolation is instance-local,
and Microsoft's own new code no longer writes LockTable in triggers. The
defect was the code fix, which returned the unchanged document whenever the
invocation had no member-access receiver.

- Code fix: a bare LockTable() becomes a bare ReadIsolation(IsolationLevel::UpdLock);
  member-access receivers keep their form; the replacement copies the trivia of
  the original call so indentation and comments survive.
- Fixtures: the full receiver-form set (named variable, Rec, bare, this,
  tableextension, page, TableNo OnRun, namespaced, RecordRef, arguments), both
  ReadIsolation forms as NoDiagnostic, and a leading-comment HasFix case;
  tableextension fixtures gated on SDK 13.0, this fixtures on runtime 14.0.
- Rule doc lc0031-record-instance-isolation-level.md records the trigger
  decision, the per-form verdicts and the SDK facts; the receiver-forms
  regression row now covers the code fix flavour of the gap.

Closes #530
Related: #545
Docs: ALCops/alcops.dev#185, ALCops/alcops.dev#186

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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