radio4000 icon indicating copy to clipboard operation
radio4000 copied to clipboard

Refactor away from async relationships

Open oskarrough opened this issue 7 years ago • 1 comments
trafficstars

Normally channel.get('tracks') will get local properties off of objects. But in the case of an async relationship, it will also trigger network requests. We don't control when the data is fetched.

Currently most or all of our model relationships are marked as async.

Instead it is recommended to set async: false and explicitly load the data when we need it. More information here: https://embermap.com/notes/83-the-case-against-async-relationships.

As an example, going to /200ok will not fetch one channel, but 90. That is because channel.favorites is an async relationship. It will also load ~200 image models, because they are async, too. It works but it is slowing things down considerably. We are loading much more than we need.

Opening this issue so we won't forget to refactor one day.

oskarrough avatar Jul 26 '18 10:07 oskarrough

  • [x] Remove async images https://github.com/internet4000/radio4000/issues/161
  • [ ] Remove async favorites
  • [ ] Remove async tracks?

oskarrough avatar Oct 09 '18 08:10 oskarrough