Skip to content

Expose item-slot lock state and lifecycle events - #365

Merged
ifBars merged 2 commits into
stablefrom
diffuin/295-8e0218db
Oct 16, 2026
Merged

ifBars merged 2 commits into
stablefrom
diffuin/295-8e0218db

Conversation

@diffuin

@diffuin diffuin Bot commented Oct 15, 2026

Copy link
Copy Markdown

Requested by @ifBars in #295.

Diffuin response

Confidence: Medium

Implemented the approved lock-state properties, immutable reason snapshot, and five lifecycle events. Added focused contract tests and XML documentation. Changes are ready for PR delivery with Fixes #295; PR creation is handled after this run.

Compatibility

Adds IsLocked, IsAddLocked, IsRemovalLocked, ActiveLock, ItemSlotLockInfo.LockReason, and Locked, Unlocked, ItemInstanceChanged, ItemDataChanged, and FilterChanged. Existing signatures and implementations remain unchanged. Stable IDs, save formats, and network payloads are unchanged. Builds and tests remain unverified because the container lacks a .NET SDK.

Recommended next steps

  1. ActiveLock returns a nullable immutable managed snapshot and preserves null or empty lock reasons without exposing the native owner.
  2. Each subscription stores a distinct native adapter. Duplicate removal preserves registration order and unrelated native listeners.
  3. Subscriptions belong to their wrapper; callers retain it for cleanup and resubscribe after slot replacement. State remains read-only and peer-local.
Evidence and validation

Evidence inspected

  • Verified the approved plan against the full available issue conversation and current checkout.
  • Regular and beta Mono declarations agree. Focused Mono decompilation confirms independent add/removal flags and native lock callbacks.
  • IL2CPP wrappers expose all required properties and five Il2CppSystem.Action callbacks directly.

Validation performed

  • Whitespace checks passed for all three changed files.
  • Static comparison confirmed existing Quantity, ItemInstance, AddQuantity(int amount), and constructor implementations are unchanged.
  • Checked all five native callback mappings and balanced XML documentation tags.
  • Attempted restore, build, and test commands for MonoMelon and Il2CppMelon; all stopped before execution because no .NET SDK is installed.

Runtime validation remaining

  • Run both restore/build/test graphs, including the new contract tests, with .NET 9 and matching assembly references.
  • Run hosted documentation coverage and ApiCompat against the exact target-branch assembly.
  • Human validation separately on Mono and IL2CPP: subscription cleanup, duplicate handlers, slot reuse, scene/save reload, and host/client lock and filter replication. No game or runtime validation was performed.
Diffuin run details
  • Provider: codex
  • Model: gpt-6.1-sol
  • Reasoning: xhigh (Luna advisor: complexity (high); baseline coupled implementation)
  • Elapsed: 471s
  • Codex thread: 01a13d02-1631-7430-ae3d-d774ae55964d

AI notice: Generated with AI assistance and not guaranteed accurate. Verify findings and plans against the current source and runtime.

Closes #295


Diffuin job: 8e0218db-3cf5-4593-8f65-662bf6068035
Commit: 1a6c190c19f6a3f6ce2951f14194f16f5683b86c

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1573d38-66e7-4381-832e-3acc1fe3af66

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Comment thread S1API.Tests/Items/ItemSlotInstanceTests.cs
@diffuin

diffuin Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Author

I updated this pull request with commit 108fbfb.

Diffuin response

Confidence: High

Added the missing FishNet.Runtime reference to the Mono test project. The reported CI compile failure applies to the current PR head and is addressed; the test suite could not run because dotnet is unavailable.

Recommended next steps

  1. Kept the fix to the Mono test project because the constructor call is compiled only under MONOMELON.
Evidence and validation

Evidence inspected

  • The current PR head still constructs NativeItemSlotLock in the MONOMELON test fixture at S1API.Tests/Items/ItemSlotInstanceTests.cs:166.
  • The available stripped Mono declaration for ItemSlotLock shows a constructor taking NetworkObject.
  • S1API.Tests/S1API.Tests.csproj now references FishNet.Runtime in its MonoMelon item group at lines 44–46.

Validation performed

  • git diff --check passed.

Runtime validation remaining

  • Could not run the Mono test project: dotnet is not installed in the environment. CI must confirm compilation and test execution.
Diffuin run details
  • Provider: codex
  • Model: gpt-6-luna
  • Reasoning: high (Luna advisor: complexity (high); baseline coupled implementation)
  • Elapsed: 70s
  • Codex thread: 01a13d4d-f85a-7fa0-9470-cd720ec5bdb9

AI notice: Generated with AI assistance and not guaranteed accurate. Verify findings and plans against the current source and runtime.

@ifBars ifBars self-assigned this Oct 15, 2026
@ifBars ifBars added the enhancement New feature or request label Oct 15, 2026
@ifBars
ifBars merged commit afc8b5a into stable Oct 16, 2026
7 checks passed
@ifBars
ifBars deleted the diffuin/295-8e0218db branch October 16, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add item-slot lock state and lifecycle events

1 participant