Skip to content

fix: harden callback safety, SlideAnchor guards, and easing validation#52

Merged
Xerrion merged 1 commit intomasterfrom
fix/engine-safety-and-validation
Feb 24, 2026
Merged

fix: harden callback safety, SlideAnchor guards, and easing validation#52
Xerrion merged 1 commit intomasterfrom
fix/engine-safety-and-validation

Conversation

@Xerrion
Copy link
Collaborator

@Xerrion Xerrion commented Feb 24, 2026

  • SlideAnchor now errors when called without an active animation
    instead of silently falling through to a no-op UpdateAnchor path
  • SlideAnchor validates duration is a positive number, preventing
    division-by-zero/nil in the OnUpdate slide interpolation
  • Wrap Animate onFinished and queue-level onFinished callbacks in
    pcall + geterrorhandler, matching the existing per-step pattern
  • RegisterAnimation validates cubic-bezier easing table shape (4
    numeric values) and rejects non-string/non-table easing types

- SlideAnchor now errors when called without an active animation
  instead of silently falling through to a no-op UpdateAnchor path
- SlideAnchor validates duration is a positive number, preventing
  division-by-zero/nil in the OnUpdate slide interpolation
- Wrap Animate onFinished and queue-level onFinished callbacks in
  pcall + geterrorhandler, matching the existing per-step pattern
- RegisterAnimation validates cubic-bezier easing table shape (4
  numeric values) and rejects non-string/non-table easing types
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the animation library's robustness by adding critical validation and error handling for callbacks, slide operations, and easing specifications. These changes prevent runtime errors that could crash the animation engine or cause silent failures.

Changes:

  • Wrapped all user-facing onFinished callbacks in pcall + geterrorhandler to prevent callback errors from crashing the OnUpdate loop or queue processing
  • Made SlideAnchor require an active animation and validate duration is a positive number, preventing division-by-zero errors in slide interpolation
  • Added comprehensive validation for cubic-bezier easing tables in RegisterAnimation, ensuring they have exactly 4 numeric values before usage

@Xerrion Xerrion merged commit bf71c6a into master Feb 24, 2026
5 checks passed
@Xerrion Xerrion deleted the fix/engine-safety-and-validation branch February 24, 2026 15:29
Xerrion pushed a commit that referenced this pull request Feb 24, 2026
🤖 I have created a release *beep* *boop*
---


## [3.5.5](3.5.4...3.5.5)
(2026-02-24)


### Bug Fixes

* apply initial keyframe immediately in Animate() to prevent frame
overlap ([#48](#48))
([b5ea1d2](b5ea1d2))
* harden callback safety, SlideAnchor guards, and easing validation
([#52](#52))
([bf71c6a](bf71c6a))
* prevent anchor drift when animations complete with an onFinished
callback ([#47](#47))
([e4a9d04](e4a9d04))


### Documentation

* add bug report and feature request issue templates
([#53](#53))
([ec638f6](ec638f6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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