Repository navigation
feat: Support getExperimentFlag, trackEvent and trackExposure methods - #214
flagsmithsmith[bot] wants to merge 5 commits into
Conversation
Its entry in Flagsmith/sdk-spec's compatibility matrix at v0.7.1: `core or events or local-evaluation`.
|
Important Review skippedThis PR was authored by a bot without an assigned CodeRabbit review seat. Ask an organization administrator to assign a seat to the bot. See the seat-assignment guide. After the seat is assigned, request a review again.
|
Merging this PR will not alter performance1 warning
Comparing |
Implements the `@events` capability of SDK spec v0.6.0, opt-in with `EnableEvents`: - `GetExperimentFlag` gets an identity's flag and records a `$flag_exposure` for the variant it was served, when the identity is enrolled in a running experiment on the feature. - `TrackEvent` and `TrackExposureEvent` record application events and exposures; `FlushEvents` sends them now. - Events are buffered and sent to the Flagsmith events API in batches, on a timer and when the buffer fills. Equal exposures are sent once per batch; a batch is retried once on a server or connection error, then dropped. - `Flag` exposes the `Variant` and `Experiment` that remote identity evaluation returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 78121ba)
…e ones - Reject a non-positive EventsFlushInterval up front. - FlushEvents now also waits for batches already being sent, e.g. after the buffer filled, so no events are lost on shutdown. - Send logs and drops batches it cannot serialise or send for any other reason, instead of leaving an unobserved exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit eb67c78)
|
The spec run failed because v0.7.1 adds the Changes
Verified locally: build and |
SDK spec v0.7.1 expects a flag whose value is an empty string to be returned as "", not null or a default. Cover it for remote and local evaluation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The last red run on 40dfb66 was not caused by the code. In Changes
Verified locally: |
getExperimentFlag, trackEvent and trackExposure methods
Contributes to Flagsmith/sdk-spec#13
Implements the SDK spec's v0.7.1 in this SDK.
It includes Renovate's bump, #213, which closes itself once this is merged.
Carries over earlier work: 8e598d8, 3b73d6a.