entity icon indicating copy to clipboard operation
entity copied to clipboard

SecondaryCacheLoader.fetchObjectsFromDatabaseAsync should return sparse map

Open wschurman opened this issue 3 years ago • 0 comments

Context: https://github.com/expo/universe/pull/7641/files/90dc1071ada997f57c0b8d33b7b0e7d7e5fe2b15#r641291143

Looking at this PR, I wonder if EntitySecondaryCacheLoader should allow this method to return "sparse" maps that are missing some of the provided keys. A missing key would mean the object was missing from the database and be treated the same way as null or undefined. This way, implementers of fetchObjectsFromDatabaseAsync wouldn't need to pad maps with null entries like this. EntitySecondaryCacheLoader would then fill in null for all of the missing keys so that the caller of the loader still gets a map with every single key in it, potentially with null values.

wschurman avatar May 28 '21 16:05 wschurman