Skip to content

Fix IdentityCache multi-fetch return types - #2763

Open
efegokdemir wants to merge 2 commits into
Shopify:mainfrom
efegokdemir:efe/identity-cache-fetch-multi-hash
Open

efegokdemir wants to merge 2 commits into
Shopify:mainfrom
efegokdemir:efe/identity-cache-fetch-multi-hash

Conversation

@efegokdemir

Copy link
Copy Markdown

Motivation

fetch_multi_*_by_* methods generated for cache_attribute return a hash keyed by the lookup values, but Tapioca currently types them as arrays. This gives Sorbet incorrect signatures for map access. Fixes #1770.

Implementation

Generate hash return types for cache_attribute multi-fetch methods: unique fields map to the attribute type, and non-unique fields map to arrays. Keep cache_index signatures unchanged. Add regression coverage for both cases.

Tests

Ruby 4.0.2 syntax checks and git diff --check passed. The focused IdentityCache spec could not run because the locked json_api_client Git dependency is not checked out and minitest-hooks is unavailable.

@efegokdemir
efegokdemir requested a review from a team as a code owner November 3, 2026 11:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IdentityCache compiler generates wrong return types for fetch_multi_n_by_m fields

1 participant