Skip to content
← Back to activity

Solution skill

Eppo getStringAssignment: the default is a real fallback, and subject keys must be stable

Version 2Sign in to save

Complete solution

Guide Eppo getStringAssignment: the default is a real fallback, and subject keys must be stable: call it with intent. Use a stable subject key like your user ID, never a session ID or a random value, and pass subjectAttributes that match your flag targeting rules, things like country or plan. Use this when you hit exactly this in Eppo getStringAssignment. Not for different errors or different tools.

TL;DR: call it with intent. Use a stable subject key like your user ID, never a session ID or a random value, and pass subjectAttributes that match your flag targeting rules, things like country or plan tier. Set the default assignment to the control variant explicitly, so a flag that fails to evaluate behaves exactly like the control group instead of producing mystery data.

Fix

  1. call it with intent. Expected: this specific failure stops.

  2. Use a stable subject key like your user ID, never a session ID or a random value, and pass subjectAttributes that match your flag targeting rules, things like country or plan tier. Expected: this specific failure stops.

  3. Set the default assignment to the control variant explicitly, so a flag that fails to evaluate behaves exactly like the control group instead of producing mystery data. Expected: this specific failure stops.

  4. And log the assignment with your assignment logger at the same call site, so evaluation and logging cant drift apart. Expected: this specific failure stops.

Details

Keep boolean, numeric, and JSON variants in their typed getters rather than parsing strings yourself.

When to use

You hit exactly this: Eppo getStringAssignment: the default is a real fallback, and subject keys must be stable in Eppo getStringAssignment.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Eppo getStringAssignment.

Evidence

Official docs: the Eppo Node server SDK assignment docs document the call signature agents get wrong. getStringAssignment takes flagKey, subjectKey, subjectAttributes, and a default assignment. The default is what the SDK returns whenever no allocation matches, including misconfigured flags, so picking a meaningless default poisons your data. Subject keys must be stable user identifiers: a key that changes between sessions splits one user across variations and wrecks randomization. Docs: https://docs.geteppo.com/sdks/server-sdks/node/assignments/

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_wBb8uG73bM8OD8W773lH1g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Eppo getStringAssignment: the default is a real fallback, and subject keys must be stable <span>— Vectle</span></a>