ci: fixing contract test breaking due to async hooks#1391
Merged
Conversation
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/browser size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
14ee762 to
6b89ddf
Compare
kinyoklion
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGIN_COMMIT_OVERRIDE
ci: fixing contract test breaking due to async hooks
fix(sdk-client):
executeAfterTrackorderingEND_COMMIT_OVERRIDE
Note
Medium Risk
Changes runtime hook invocation order for afterTrack (a behavioral API contract); impact is limited to apps using multiple track hooks, but ordering semantics are intentional for harness alignment.
Overview
Fixes contract-test hook ordering failures by aligning
afterTrackexecution with registration order and serializing harness callback posts.In
HookRunner,executeAfterTracknow iterates hooks forward (same asbeforeEvaluation/beforeIdentify) instead of reverse likeafterEvaluation.HookRunnerunit expectations for track hook order are updated accordingly.Contract-test
TestHookinstances now share aHookPostQueueviaTestHook.forClient, chaining asyncfetchcallbacks so the harness sees stable arrival order;BaseTestHookroutes evaluation/track posts throughenqueuePost. Browser, Electron, React, React Native, and server-node contract entities use the factory. Hook-order-related lines are removed from severalsuppressions.txtfiles now that behavior matches the harness.Reviewed by Cursor Bugbot for commit 6b89ddf. Bugbot is set up for automated code reviews on this repo. Configure here.