-
Couldn't load subscription status.
- Fork 44
chore(core): move actor liveness check to setInterval #1202
chore(core): move actor liveness check to setInterval #1202
Conversation
|
Claude finished @NathanFlurry's task —— View job Code Review Complete ✅Reviewing the PR that moves actor liveness check to setInterval. Analyzing the changes across 4 files:
Analysis SummaryThe PR refactors how connection liveness checks are implemented: Before: Used alarm-based scheduling with persistent events Code Quality & Best Practices ✅Excellent refactoring work:
Code improvements:
Performance Considerations ✅Significant improvements:
The change appropriately trades persistence for performance since connection liveness is inherently transient. Architecture & Logic ✅Sound architectural decisions:
Potential Issues & RecommendationsMinor concerns:
Security Considerations ✅No security concerns identified. The change reduces attack surface by eliminating persistent liveness events. Test Coverage
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
| action: event.k.g.a, | ||
| args: event.k.g.ar, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property access pattern has changed from direct access (event.a, event.ar) to nested access (event.k.g.a, event.k.g.ar), but there's no null/undefined checking for these nested properties. This could cause runtime errors when processing persisted events that don't match the new structure.
Consider adding defensive checks before accessing these nested properties:
if (!event.k?.g) {
throw new Error(`Invalid event format: missing k.g structure in event ${event.e}`);
}Or use optional chaining with fallbacks:
action: event.k?.g?.a ?? "(unknown action)",
args: event.k?.g?.ar ?? [],This would ensure backward compatibility with any persisted events in the old format.
| action: event.k.g.a, | |
| args: event.k.g.ar, | |
| action: event.k?.g?.a ?? event.a ?? "(unknown action)", | |
| args: event.k?.g?.ar ?? event.ar ?? [], |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
| await fn.call( | ||
| undefined, | ||
| this.actorContext, | ||
| ...(event.k.g.ar || []), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code accesses event.k.g.ar without first verifying that event.k and event.k.g exist. If the event structure is malformed, this could lead to a runtime error. Consider adding a null check or using optional chaining (event.k?.g?.ar || []) to handle potentially invalid event structures gracefully.
| await fn.call( | |
| undefined, | |
| this.actorContext, | |
| ...(event.k.g.ar || []), | |
| ); | |
| await fn.call( | |
| undefined, | |
| this.actorContext, | |
| ...(event.k?.g?.ar || []), | |
| ); |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
| action: event.k.g.a, | ||
| args: event.k.g.ar, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error logging code accesses event.k.g.a and event.k.g.ar directly without checking if event.k or event.k.g exist. If the event structure is malformed, this will cause additional runtime errors during error reporting, potentially obscuring the original error. Consider adding null checks or using optional chaining (event.k?.g?.a) to make the error reporting more robust.
| action: event.k.g.a, | |
| args: event.k.g.ar, | |
| action: event.k?.g?.a, | |
| args: event.k?.g?.ar, |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Merge activity
|

Fixes KIT-246