feat(internaldata): persist search comments and log changes to history - #34
Merged
Conversation
Consumes NexusKit's new IInspectSearchCommentWatcher: when the user examines somebody, SearchCommentCaptureService persists their search comment and logs a history row if it actually moved. The value goes on observed_player as search_comment, but is exposed via the lazily-loaded ObservedPlayerDetail rather than the hot ObservedPlayer record - same reasoning as the notes. ObservedPlayer holds every observed row in memory at once, and this is a per-character free-text field the list never renders. The diff lives in the capture service, not in InternalDataHistoryService.OnObservationProcessed, because the search comment never travels through the observation pipeline - the prev/current pair in PlayerObservationEvent simply does not carry it. SetSearchCommentAsync already reads the previous value in order to write, so it hands it back and the caller records the change without a second query. Notes: - PlayerHistoryKind.SearchCommentChange = 5. No migration: kind is INTEGER and the enum is byte-backed for exactly this reason. OldValue/NewValue carry raw text; either may be null, which is how "set for the first time" and "cleared" are expressed. - UpdatedAt is deliberately not bumped on write. It drives observation-freshness, and examining somebody is not a sighting of them. - Re-examining with an unchanged comment writes nothing and logs nothing. - nexus_filter_player gains a search_comment column so the plugin can offer user filters on it. The view is dropped and recreated on every startup, so no migration is involved. - NexusKit floors raised to [0.5.0,): NuGet resolves the LOWEST version satisfying a range, so leaving them at [0.4.0,) would keep CI building against a NexusKit without the watcher.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consumes NexusKit's new IInspectSearchCommentWatcher: when the user
examines somebody, SearchCommentCaptureService persists their search
comment and logs a history row if it actually moved.
The value goes on observed_player as search_comment, but is exposed via
the lazily-loaded ObservedPlayerDetail rather than the hot ObservedPlayer
record - same reasoning as the notes. ObservedPlayer holds every observed
row in memory at once, and this is a per-character free-text field the
list never renders.
The diff lives in the capture service, not in
InternalDataHistoryService.OnObservationProcessed, because the search
comment never travels through the observation pipeline - the prev/current
pair in PlayerObservationEvent simply does not carry it. SetSearchCommentAsync
already reads the previous value in order to write, so it hands it back and
the caller records the change without a second query.
Notes:
and the enum is byte-backed for exactly this reason. OldValue/NewValue
carry raw text; either may be null, which is how "set for the first time"
and "cleared" are expressed.
observation-freshness, and examining somebody is not a sighting of them.
user filters on it. The view is dropped and recreated on every startup,
so no migration is involved.
satisfying a range, so leaving them at [0.4.0,) would keep CI building
against a NexusKit without the watcher.