Skip to content

[claude] Stop the activity detail view crashing on opaque changes - #23

Closed
myieye wants to merge 4 commits into
developfrom
claude/activity-opaque-change-tolerance
Closed

myieye wants to merge 4 commits into
developfrom
claude/activity-opaque-change-tolerance

Conversation

@myieye

@myieye myieye commented Aug 18, 2026

Copy link
Copy Markdown
Owner

[Claude, autonomous]

Staging PR — never merge; promoted to sillsdev when polished (see FORK.md).

An opaque (unregistered) change with no snapshot (an opaque create) made the activity detail view throw ArgumentNullException from GetAtCommit; opaque changes now return an empty context ("Unknown", no preview, no affected entries). The new tests opt into UnknownChangeHandling.Fallback via a fixture hook — production still uses the default Throw, so unknown change types currently fail sync before ever reaching the activity view (tracked separately).

🤖 Generated with Claude Code

An opaque (unregistered) change has no snapshot when it's a create (the
entity was never materialized on this client), so LoadChangeContext threw
ArgumentNullException from GetAtCommit. Return an empty context for opaque
changes instead: "Unknown" name, no preview, no affected entries. Opaque
edits get the empty context too; their snapshot would show the entity
state excluding the very change being viewed.

The tests opt into UnknownChangeHandling.Fallback through a new fixture
hook. Production keeps the default Throw for now, so unknown change types
fail sync outright and never reach the activity view.

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

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

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: Pro

Run ID: c72a5010-c231-450a-a417-15a72331795d

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b26b621-cf2a-40e4-89af-0e322b22f78e

📥 Commits

Reviewing files that changed from the base of the PR and between e883511 and 265e715.

📒 Files selected for processing (3)
  • backend/FwLite/LcmCrdt.Tests/HistoryServiceOpaqueChangeTests.cs
  • backend/FwLite/LcmCrdt.Tests/LcmCrdtTestsKernel.cs
  • backend/FwLite/LcmCrdt/HistoryService.cs

Included review availability: 4 reviews are currently available. Based on recent review activity, included reviews refill at 5 per hour.


📝 Walkthrough

Walkthrough

The changes enable fallback deserialization for unknown Harmony changes. HistoryService.LoadChangeContext now returns an empty context for OpaqueChange values. Tests cover activity projection, opaque edits, and opaque creates.

Changes

Opaque change handling

Layer / File(s) Summary
Fallback test configuration
backend/FwLite/LcmCrdt.Tests/LcmCrdtTestsKernel.cs
Test services enable UnknownChangeHandling.Fallback for Harmony changes.
Opaque history context handling
backend/FwLite/LcmCrdt/HistoryService.cs, backend/FwLite/LcmCrdt.Tests/HistoryServiceOpaqueChangeTests.cs
LoadChangeContext returns no snapshots or affected entries for OpaqueChange. Tests verify "Unknown" activity names and null subject metadata for opaque edits and creates.

Suggested reviewers: hahn-kev

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

The per-fixture override raced: the IChange converter (which bakes in
UnknownChangeHandling) lives in the EF model, and EF caches the model
process-wide, so whichever fixture built it first decided the behavior
for the whole run. Passed locally when the opaque tests ran first,
failed on CI when a default-Throw fixture won.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@myieye

myieye commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

myieye and others added 2 commits August 18, 2026 18:00
Review asked not to flip the setting for every test while prod still uses
Throw. The per-fixture override originally raced because the setting is
baked into the process-cached EF model; the fixture now disables EF
service-provider caching whenever a configureServices hook is present, so
hook config gets its own model. An isolation test pins the race: it fails
if the caching opt-out is removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review call: if fallback silently stops applying, the opaque tests fail
loudly anyway; the guard isn't worth its review noise.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@myieye

myieye commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Promoted to sillsdev#2796

@myieye myieye closed this Oct 23, 2026
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