Skip to content

Object: Rework how Object.normalize works

lain requested to merge object-normalize-refactor into develop

Now it defaults to not fetching, and the option is named.

The idea of this function was to make it transparent whether we had some object in our db or if we needed to fetch it first. I don't think this was a good idea, because it's very hard to figure out where foreign data can enter our db this way. For example, a View could actually go out and fetch an object. It could also make things slower by trying to fetch things that we don't actually want to fetch if we don't have them, like local or private posts.

The rework now makes every call to Object.normalize explicit. This was mainly done to check every occurrence of it to see if it really needs fetching or not. You can still call Object.normalize(something), but it will default to NOT fetching instead of the other way around.

Merge request reports