Skip to content

ci: fixing contract test breaking due to async hooks#1391

Merged
joker23 merged 2 commits into
mainfrom
skz/contract-test-failures
May 26, 2026
Merged

ci: fixing contract test breaking due to async hooks#1391
joker23 merged 2 commits into
mainfrom
skz/contract-test-failures

Conversation

@joker23
Copy link
Copy Markdown
Contributor

@joker23 joker23 commented May 26, 2026

BEGIN_COMMIT_OVERRIDE
ci: fixing contract test breaking due to async hooks

fix(sdk-client): executeAfterTrack ordering
END_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 afterTrack execution with registration order and serializing harness callback posts.

In HookRunner, executeAfterTrack now iterates hooks forward (same as beforeEvaluation / beforeIdentify) instead of reverse like afterEvaluation. HookRunner unit expectations for track hook order are updated accordingly.

Contract-test TestHook instances now share a HookPostQueue via TestHook.forClient, chaining async fetch callbacks so the harness sees stable arrival order; BaseTestHook routes evaluation/track posts through enqueuePost. Browser, Electron, React, React Native, and server-node contract entities use the factory. Hook-order-related lines are removed from several suppressions.txt files 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.

@joker23 joker23 requested a review from a team as a code owner May 26, 2026 19:51
@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26389 bytes
Compressed size limit: 29000
Uncompressed size: 129320 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179496 bytes
Compressed size limit: 200000
Uncompressed size: 830875 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31870 bytes
Compressed size limit: 34000
Uncompressed size: 113696 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38516 bytes
Compressed size limit: 39000
Uncompressed size: 211129 bytes

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

@joker23 joker23 force-pushed the skz/contract-test-failures branch from 14ee762 to 6b89ddf Compare May 26, 2026 20:53
@joker23 joker23 merged commit 58e063b into main May 26, 2026
45 checks passed
@joker23 joker23 deleted the skz/contract-test-failures branch May 26, 2026 22:10
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