Skip to content

statsig-ffi, statsig-pyo3: fix missing exposure_dedupe_max_keys in initializers#7

Merged
nsaini-figma merged 1 commit into
mainfrom
nsaini/fix-statsig-options-c-missing-field
May 14, 2026
Merged

statsig-ffi, statsig-pyo3: fix missing exposure_dedupe_max_keys in initializers#7
nsaini-figma merged 1 commit into
mainfrom
nsaini/fix-statsig-options-c-missing-field

Conversation

@nsaini-figma
Copy link
Copy Markdown
Collaborator

Summary

The bounded-LRU change in PR #4 added a new field exposure_dedupe_max_keys: Option<usize> to StatsigOptions. Two sibling crates have exhaustive struct literals (no ..StatsigOptions::default()) and now fail to compile with E0063 "missing field":

  • statsig-ffi/src/statsig_options_c.rs:139
  • statsig-pyo3/src/statsig_options_py.rs:334

Both initializers now include exposure_dedupe_max_keys: None. Non-Rust callers (C and Python) retain the existing behavior of using the SAMPLING_MAX_KEYS default; surfacing the new option to those bindings would require additional plumbing through StatsigOptionsData and StatsigOptionsPy which is out of scope here.

Why

cross build --release -p statsig_ffi (the release workflow's build step) fails because of the missing field. The actual error from a failed run on main after merging PR #4:

```
error[E0063]: missing field `exposure_dedupe_max_keys` in initializer of `StatsigOptions`
--> statsig-ffi/src/statsig_options_c.rs:139:9
139 | Self {
| ^^^^ missing `exposure_dedupe_max_keys`
```

The other exhaustive struct literal in the same file (line 278) already uses `..StatsigOptions::new()` and is unaffected.

Test plan

  • `cargo build --release -p statsig_ffi` succeeds
  • `cargo build --release -p statsig-pyo3` succeeds (if pyo3 deps are installable)
  • After merge, re-cut `statsig-go/v0.19.4-figma1` and confirm the figma-release workflow completes end-to-end

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

… initializers

The bounded-LRU change added a new field `exposure_dedupe_max_keys` to
StatsigOptions but two sibling crates have exhaustive struct literals
that don't use `..StatsigOptions::default()`:

  statsig-ffi/src/statsig_options_c.rs:139
  statsig-pyo3/src/statsig_options_py.rs:334

Both now fail to compile with E0063 "missing field". This PR adds the
field (defaulted to None) to both initializers so cdylib and Python
bindings builds compile again.

The C/Python bindings don't surface the new option to callers — that
would require adding fields to StatsigOptionsData (C) and
StatsigOptionsPy (Python) and threading them through. Defaulting to
None preserves the existing behavior (uses SAMPLING_MAX_KEYS) for
non-Rust callers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nsaini-figma nsaini-figma marked this pull request as ready for review May 14, 2026 19:00
@nsaini-figma nsaini-figma merged commit 1245057 into main May 14, 2026
4 checks passed
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