Skip to content

List Randomizer silently caps oversized sample requests without warning #361

Description

@baixiangcpp

Summary

In Sample mode without replacement, requesting more samples than the available source items silently returns fewer items while announcing Randomize completed.. The requested count remains visible, so the result does not match the request and no explanation is shown.

Reproduction

  1. Open https://byteflow.tools/en/list-randomizer.
  2. Use Sample mode.
  3. Enter this list:
a
b
c
  1. Leave Remove duplicate items unchecked.
  2. Leave Sample with replacement unchecked.
  3. Set Sample Count to 10.
  4. Set Seed to 1.
  5. Click Randomize.

Expected

Either reject the request with a clear validation error (the guide lists Sample count exceeds source length as a common error), or explicitly explain that the result is being capped at the source length.

Actual

  • The page announces Randomize completed..
  • The control still shows Sample Count: 10.
  • Output metadata says Source Items: 3 Result Items: 3 Sample Count: 10.
  • The output contains only b, c, and a.
  • No error or warning is shown.

Observed output:

Mode: Sample Source Items: 3 Result Items: 3 Dedupe: No With Replacement: No Sample Count: 10 Seed: 1
1. b
2. c
3. a

With Sample with replacement enabled, the same request correctly returns 10 items, so the silent under-result is specific to the invalid no-replacement request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions