Skip to content

Fix LT-21598: Crash deleting from Bulk Edit Entries#380

Open
mark-sil wants to merge 1 commit into
masterfrom
LT-21598-fix-bulk-delete-crash
Open

Fix LT-21598: Crash deleting from Bulk Edit Entries#380
mark-sil wants to merge 1 commit into
masterfrom
LT-21598-fix-bulk-delete-crash

Conversation

@mark-sil

@mark-sil mark-sil commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Bulk deleting lexical entries that participate in a lexical relation could crash with a NullReferenceException (LT-21598). The attached project (Puntipi-Luritja) has corrupt data — a lost incoming-reference index, not repaired by Find and Fix — so a LexReference can still list a target that has already been deleted. During the deletion cascade, LexReference's removal side effects operated on those already-deleted objects and dereferenced their cleared cache.

Changes (LexReference in OverridesLing_Lex.cs)

  • UpdateMinimalLexReferences skips targets that are no longer valid.
  • RemoveObjectSideEffectsInternal only updates the removed object's back-reference virtual properties (LexEntryReferences / LexSenseReferences / DateModified) while it is still valid; the remaining valid targets are still refreshed via UpdateMinimalLexReferences.

Testing

  • Added two regression tests in LingTests.cs, each verified to fail at the exact reported stack without its fix.
  • Full LCM test suite passes (net8.0): 2806 passed, 0 failed, 20 skipped.
  • Verified manually in FLEx: Bulk Edit Entries → Delete on the Puntipi-Luritja project no longer crashes.

🤖 Generated with Claude Code


This change is Reviewable

Bulk deleting lexical entries that participate in a lexical relation could
crash with a NullReferenceException. With corrupt data (a lost incoming-
reference index, not repaired by Find and Fix) a LexReference can still list
a target that has already been deleted. During the deletion cascade, the
LexReference removal side effects operated on those already-deleted objects
and dereferenced their cleared cache.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

LCM Tests

    16 files  ±0      16 suites  ±0   3m 24s ⏱️ +9s
 2 862 tests +2   2 842 ✅ +2   20 💤 ±0  0 ❌ ±0 
11 396 runs  +8  11 228 ✅ +8  168 💤 ±0  0 ❌ ±0 

Results for commit ff022e4. ± Comparison against base commit c4d88bb.

@hahn-kev hahn-kev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, the tests reproduce the issue and fail without the fix.

One thing I did notice, that may effect something, is that the order in which UpdateMinimalLexReferences and UpdateLexEntryReferences is called has changed. The old version would call UpdateLex first, then UpdateMinimal however the new version changes that. I'm not sure if this was intentional but we might consider putting it back to how it was.

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.

2 participants