Shopify / Shopify/liquid

The new `find` filter doesn't work as expected on paginated arrays

Open
#1,941 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Report
Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

By default, product.variants are limited to 250 variants. When you use the find filter on this array, it only searches within those first 250 variants instead of all variants of the product.

For example:

assign variant = product.variants | find: 'id', variant_id
echo variant

This code will only work if the variant_id is within the first 250 variants.

Is this a known limitation?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source files or tests. Start by reproducing the Liquid example with a product containing more than 250 variants, then trace how find handles the paginated product.variants array. Done should include a confirmed decision on whether this is a limitation or a bug and corresponding project changes, but the issue does not define that outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.