Skip to content

Fix dynamic frame callback activation - #275

Draft
brandtnewlabs wants to merge 2 commits into
agent/fix-candle-width-timeframe-switchfrom
agent/fix-dynamic-frame-callback-activation
Draft

Fix dynamic frame callback activation#275
brandtnewlabs wants to merge 2 commits into
agent/fix-candle-width-timeframe-switchfrom
agent/fix-dynamic-frame-callback-activation

Conversation

@brandtnewlabs

@brandtnewlabs brandtnewlabs commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • synchronize the core engine, candle-width interpolation, marker projection / hit testing, and trade-stream frame callbacks when static changes after mount
  • keep degen activation lifecycle-safe through conditional mounting, and verify the remaining useFrameCallback sites use constant activation or already synchronize it
  • document that static can be toggled at runtime and add regression coverage for live → static → live transitions

This is a focused follow-up stacked on #274 and addresses the broader audit raised in #273.

Audit result

Reanimated's autostart argument seeds the callback's active state when the hook mounts; changing the argument later does not update that state. Every callback whose activation can change during the component lifetime now calls the returned handle's setActive method from an effect.

The remaining callback sites are safe because their activation is constant for the mounted component, are conditionally mounted with the feature, or already synchronize the returned handle.

Verification

  • npm run typecheck
  • npm run lint
  • npm test -- --silent — 104 suites, 1,580 passing tests
  • React Doctor — no issues found
  • iOS simulator before/after coverage for engine time, candle-width interpolation, marker projection / hit testing, trade stream, and live → static suspension

Before

The static → live chart keeps a frozen engine clock, retains the stale candle
width, emits no trade labels, and misses the visible marker. The live → static
chart keeps advancing instead of suspending its frame work.

▶ Watch or download the before video

After

The same scenario resumes the engine, renders the new candle width and trades,
hits the marker, and freezes every frame loop again when returning to static.

▶ Watch or download the after video

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.

1 participant