Shopify / tapioca

The swiss army knife of RBI generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IdentityCache compiler misses a fetch_multi_*

bitwise-aiden opened this issue · comments

Description

When using cache_attribute with multiple by fields, the resulting fetch_multi_field_a_by_field_b_and_field_c method is not created.

It appears as though there is a length check that is preventing this from being generated. Looking back to where it appears to be introduced, there isn't clear indication of what this check was intended for.

One approach to solving could be removing the check and seeing what breaks, or adding a create_attribute_fetch_by_methods method to create for this case.

There wasn't support for composite keys until Shopify/identity_cache#534. The compiler will have to be updated to reflect these changes.

Yup! Is the preferred adding a new create_attribute_fetch_by_methods to handle this? The length check in the compiler predates the cache_attribute addition, so I don't want to mess with that.

Looking at the PR diff I think removing the length check will be enough. If you're going ahead with the solution I'd say let's remove it and then add new tests and see. I don't have IDC context.