Skip to content

feat: Attach traits to experiment exposures and run SDK spec v0.7.1 event scenarios - #109

Merged
Zaimwa9 merged 6 commits into
mainfrom
openhands/sdk-spec-v0.7.1
Nov 9, 2026
Merged

Zaimwa9 merged 6 commits into
mainfrom
openhands/sdk-spec-v0.7.1

Conversation

@flagsmithsmith

@flagsmithsmith flagsmithsmith Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

getExperimentFlag, trackEvent and trackExposureEvent already shipped in #94. This PR runs the event scenarios of SDK spec v0.7.1 against them and fixes the two gaps they found: exposures were missing the identity's traits, and a failed scheduled analytics flush crashed the app.

Changes

  • Exposures recorded by getExperimentFlag include the traits passed to it.
  • A failed scheduled flag analytics flush no longer crashes the app; it is retried on the next interval.
  • CI runs the core and event scenarios of SDK spec v0.7.1.

Contributes to Flagsmith/sdk-spec#13

Review effort: 2/5

renovate Bot and others added 6 commits November 5, 2026 17:39
Its entry in Flagsmith/sdk-spec's compatibility matrix at v0.7.1: `core or events`.
The flag analytics timer left the error of a failed send unhandled, so a
network failure or an error response from Flagsmith crashed the app with
an uncaught exception. The timer now drops the error, which
syncAnalyticsData has already logged, and resends on the next tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 36a294b)
(cherry picked from commit 56b56c5)
An exposure recorded by getExperimentFlag now carries the traits the
identity was evaluated with, as the other Flagsmith SDKs do, so that
experiment results can be analysed by trait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b5f536a)
(cherry picked from commit 53f3740)
Wires the spec's new steps to the SDK's event tracking: creating a
client with events enabled, getExperimentFlag, trackEvent and
trackExposureEvent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 180ac98)
(cherry picked from commit 4ffb1fc)
…elay

A fixed 100 ms wait could see fewer scheduled sends than expected. The test
now waits for the second failed send, which also ensures the first failure
has been handled before the test ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d76c743)
(cherry picked from commit fc55779)
@flagsmithsmith flagsmithsmith Bot added the sdk-spec Bumps of the Flagsmith SDK behavioural spec label Nov 5, 2026
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fdad39a8-879f-4d1e-b5f7-625e2a133740

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@flagsmithsmith
flagsmithsmith Bot marked this pull request as ready for review November 5, 2026 20:10
@flagsmithsmith
flagsmithsmith Bot requested a review from a team as a code owner November 5, 2026 20:10
@flagsmithsmith
flagsmithsmith Bot requested review from talissoncosta and removed request for a team November 5, 2026 20:10
@flagsmithsmith flagsmithsmith Bot changed the title feat: Implement SDK spec v0.7.1 feat: Support getExperimentFlag, trackEvent and trackExposure methods Nov 6, 2026

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change the PR title to describe precisely the change from this PR (as this is not the full implementation

@flagsmithsmith flagsmithsmith Bot changed the title feat: Support getExperimentFlag, trackEvent and trackExposure methods feat: Attach traits to experiment exposures and run SDK spec v0.7.1 event scenarios Nov 9, 2026
@flagsmithsmith

flagsmithsmith Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Change the PR title to describe precisely the change from this PR (as this is not the full implementation

Done. The title is now feat: Attach traits to experiment exposures and run SDK spec v0.7.1 event scenarios. I also rewrote the description: it now says that getExperimentFlag, trackEvent and trackExposureEvent came in #94, and lists only what this PR changes. This needed no new commit.

The PR also contains a bug fix: a failed scheduled analytics flush no longer crashes the app (6dbe991). The new spec scenarios exposed it, so I kept it here and listed it in the description. If you'd rather review it as a separate fix: PR, I can move it out.

@Zaimwa9
Zaimwa9 merged commit ad7295e into main Nov 9, 2026
9 checks passed
@Zaimwa9
Zaimwa9 deleted the openhands/sdk-spec-v0.7.1 branch November 9, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-spec Bumps of the Flagsmith SDK behavioural spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants