Skip to content

Optimize UpdateStateInCache() - #529

Merged
SergeiPavlov merged 4 commits into
master-servicetitanfrom
UpdateStateInCache
Oct 5, 2026
Merged

SergeiPavlov merged 4 commits into
master-servicetitanfrom
UpdateStateInCache

Conversation

@SergeiPavlov

@SergeiPavlov SergeiPavlov commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator
  • Change parameter type to IReadOnlyList<> to avoid redundant .ToList()
  • Remove unused auxEntities parameter

Note

Medium Risk
Touches internal entity-set cache and prefetch state updates across the session pipeline; behavior should be unchanged if auxEntities was truly unused, but any latent auxiliary-entity handling is removed.

Overview
Streamlines how entity-set membership is written into the session cache after prefetch and related loads.

UpdateState / UpdateStateInCache now take IReadOnlyList<Key> instead of IEnumerable<Key>, and EntitySetBase.UpdateState passes the list through without an extra .ToList(). The auxEntities argument is dropped from the session-handler chain (SessionHandler, ChainingSessionHandler, Session.Cache) and from prefetch EntitySetTask.UpdateCache.

Prefetch cache refresh is tightened: manager.Owner is cached locally, the per-record loop uses pattern matching and a single branch for direct vs auxiliary associations (still skipping the auxiliary row at index 0), and entity-set state is updated with only the collected entityKeys.

Reviewed by Cursor Bugbot for commit deef818. Bugbot is set up for automated code reviews on this repo. Configure here.

@SergeiPavlov
SergeiPavlov merged commit f56771a into master-servicetitan Oct 5, 2026
8 checks passed
@SergeiPavlov
SergeiPavlov deleted the UpdateStateInCache branch October 5, 2026 22:23
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