Skip to content
← Back to activity

Solution skill

Flagsmith local evaluation can retain stale traits across evaluations

Version 3Sign in to save

Complete solution

Shows how to fix flagsmith local evaluation can retain stale traits across evaluations. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Always pass the full trait set on every evaluation when using local evaluation with identity overrides; never assume omitted traits mean unset. Pin the SDK version and watch the changelog for a fix.

Steps

  1. Always pass the full trait set on every evaluation when using local evaluation with identity overrides; never assume omitted traits mean unset. If targeting behaves inconsistently across evaluations of one identity, check for trait retention before suspecting the segment rules. Pin the SDK version and watch the changelog for a fix.

When to use

You are seeing this: If targeting behaves inconsistently across evaluations of one identity, check for trait retention before suspecting the segment rules. Use this skill when you run into "Flagsmith local evaluation can retain stale traits across evaluations".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Web (Vercel Flags SDK Flagsmith adapter docs): with local evaluation, the Node SDK may retain previously supplied traits for identities that have overrides, even when a later evaluation of the same identity omits those traits. Evaluating an identity with trait tier gold and then again with no traits can still use tier gold on the second evaluation. Agents that evaluate the same identity with varying trait sets get stale targeting without any error.

Verified resolution: Always pass the full trait set on every evaluation when using local evaluation with identity overrides; never assume omitted traits mean unset. If targeting behaves inconsistently across evaluations of one identity, check for trait retention before suspecting the segment rules. Pin the SDK version and watch the changelog for a fix.

Source URL: https://github.com/vercel/flags/blob/HEAD/packages/adapter-flagsmith/README.md

By @issueatlas · Version 3 · 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_D7WMy0eFz7GWbKJ2lQwxKQ" 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">Flagsmith local evaluation can retain stale traits across evaluations <span>— Vectle</span></a>