Skip to content

Object Update Trigger - #40

Merged
milt merged 40 commits into
mainfrom
object_update_trigger
Aug 5, 2026
Merged

Object Update Trigger#40
milt merged 40 commits into
mainfrom
object_update_trigger

Conversation

@milt

@milt milt commented Jul 27, 2026

Copy link
Copy Markdown
Member

Trigger statement emission from object updates

  • Make Object Cache reflection writes atomic
  • Introduce three new trigger types: ObjectCreate, ObjectUpdate and ObjectDelete
    • ObjectCreate is fired at most once when an object is created, upon the first reflection of requested attributes
    • ObjectUpdate is fired on every update (including the first reflection).
      • The previous expression is now available in ObjectUpdate to refer to the previous state of the object. This can be used to implement change detection.
    • ObjectDelete is fired at most once when an object is deleted.
      • The trigger expression in ObjectDelete can access a snapshot of the object's attributes prior to deletion.
  • Overhaul object subscription to merge requested class attributes via their hierarchy
  • prevent cache misses across class hierarchies in queries
  • Canonical naming for interaction and object classes

@milt
milt marked this pull request as ready for review July 28, 2026 20:31
@milt
milt requested a review from cliffcaseyyet July 28, 2026 20:31

@cliffcaseyyet cliffcaseyyet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very cool, I understand this iteration better than the ones before it. Most of my stuff is organizational or minor but what it's actually doing makes sense.

Comment thread doc/xapi-config.md Outdated
Comment thread src/main/java/com/yetanalytics/hlaxapi/StatementTriggerDispatcher.java Outdated
Comment thread src/main/java/com/yetanalytics/hlaxapi/injection/InjectionContext.java Outdated
if (injectionContext instanceof TestInjectionContext) {
return handler.handleLookup(null, target, injectionContext);
if (injectionContext instanceof TestInjectionContext testContext) {
return handler.handleLookup(alias, definitions.get(alias), target, testContext);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'm having trouble figuring out what this is doing, perhaps i didn't understand what it was doing before either and why it needs to be different from the non-validation runs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I did catch up to this in another comment but i'll leave it here until that one is figured out.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't want to start up the cache when doing test injection is all! This is a bypass.

Comment thread src/main/java/com/yetanalytics/hlaxapi/InjectionHandler.java Outdated
return objectCache.findValueResolution(object, attrTarget);
}

public ValueResolution handleLookup(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah ok i think i get it now per my other question. It cannot pass a CachedObject as the others do beacuse it doesn't have one.

I think part of why this is weird is that it's chosen to already resolve the cachedobject outside the injection handler instead of having the injectionhandler do that work on receiving the details of an injection. Might be worth considering a refactor there, but perhaps there is another structural reason it needs to be done before the injection is being handled?

@milt
milt merged commit a38df76 into main Aug 5, 2026
1 check passed
@milt
milt deleted the object_update_trigger branch August 5, 2026 17:25
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