Repository navigation
feat: Support getExperimentFlag, trackEvent and trackExposure methods - #252
flagsmithsmith[bot] wants to merge 4 commits into
Conversation
Its entry in Flagsmith/sdk-spec's compatibility matrix at v0.8.0: `core or events or local-evaluation`.
Spec v0.7.1 runs the `@events` scenarios for this SDK: getting an experiment flag, tracking an event and tracking an exposure event, all with events enabled. The SDK already implements these (#226), so the steps file wires each step to FlagsmithClient.getExperimentFlag, trackEvent and trackExposureEvent, and creates the events-enabled client through FlagsmithConfig, next to the local evaluation client. (cherry picked from commit 0c48af8) Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 29cbe7b)
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Spec v0.8.0 specifies how SDKs deliver events. The event processor now: - Times out each events request after 3 s, and gives a batch 3 attempts, backing off from 1 s, doubling, with full jitter. Network errors, timeouts, 408, 429, 500, 502, 503 and 504 are retried. - Keeps a batch whose last attempt failed transiently in the buffer, ahead of newer events, for the next flush, unless that attempt got a 500. Any other error response drops the batch. - Stops event tracking, dropping the buffer, on a 401 or 403. - Sends one batch at a time, and caps the buffer at 1000 events by dropping the oldest, kept events included. - Never fails `flushEvents()`, which waits for the send, retries included. `FlagsmithClient.close(timeout, unit)` sends the buffered events for at most the timeout, then abandons the request in flight. `close()` waits for one batch's worst case, 12 s. The spec steps file wires the new steps: flushing events, closing with a timeout, tracking a range of events, and a client with both local evaluation and events enabled. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pushed 88fa258 to fix the SDK changes (
Client: new Steps: Tests: Locally, |
|
Superseded by #253, which carries this pull request's work over to the SDK spec's latest version. |
Contributes to Flagsmith/sdk-spec#13
Contributes to Flagsmith/sdk-spec#23