Skip to content

Allocation time not handled properly #22

@maciej-perplexity

Description

@maciej-perplexity

Using v2.0.0 from #18

Here's my flag config, it has no explicit constraints:

Image

This is represented in the JSON like this:

      "allocations": [
        {
          "key": "allocation-19715",
          "startAt": "2025-02-26T14:25:07.046Z",
          "endAt": "9999-12-31T00:00:00.000Z",
          "splits": [
            {
              "variationKey": "v14",
              "shards": []
            }
          ],
          "doLog": true
        }
      ]

(This is the real JSON I got from our production eppo endpoint)

After it gets parsed, I debug into evalflags.cpp and I enter this code:

    // Check time constraints
    if (allocation.startAt.has_value() && now < allocation.startAt.value()) {
        details.allocationEvaluationCode = AllocationEvaluationCode::BEFORE_START_TIME;
        return details;
    }
    if (allocation.endAt.has_value() && now > allocation.endAt.value()) {
        details.allocationEvaluationCode = AllocationEvaluationCode::AFTER_END_TIME;
        return details;
    }
  • now is {__d_={__rep_=1764088767721261 } }
  • allocation.startAt has a value and its {__d_={__rep_=1740579907046000 } }
  • allocation.endAt also has a value and its {__d_={__rep_=0 } }
  • now is therefore higher than allocation.endAt and this allocation is skipped with AllocationEvaluationCode::AFTER_END_TIME

This makes every assignment error out.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions