waihon / library-ui

https://elibui.herokuapp.com - The Library SPA developed using Ember.js Octane and popular addons as part of the Full Stack Ember with Rails course.
0 stars 0 forks source link

Issues in Branch 35-mirage-for-dev-3-28 #1

Open waihon opened 3 years ago

waihon commented 3 years ago

The are 2 issues in the above-mentioned branch which uses Mirage (as a mock server for development) and after upgrading Ember.js from 3.21 to 3.28:

  1. The relationship is not loaded most of the time. For example:
    • On the Book Detail page, the author name and reviews were blanks (books/:id/author and books/:id/reviews are not called according to the Console tab).
    • On the Author Detail page, the books list is empty (author:/:id/books is not called according to the Console tab)
  2. The API server (Mirage in this branch) is hit continuously when searching for an author on ember-power-select drop-down.
    • For example: During book creation, when searching for an author, after typing a few characters and the query result shown, according to the Console tab, the API server (Mirage is in this) was being hit with the same query continuously, until an author was selected.
    • This issue has been reported at: https://github.com/cibernox/ember-power-select/issues/1482. There's a suggested solution using Ember Concurrency (which is a third-party addon if not mistaken).
    • I'd like to see if there's any solution using Ember or Ember Data itself instead of a third-party addon.

Here's a video illustrating the above issues on the app running on Ember.js 3.28: https://user-images.githubusercontent.com/1195433/144527024-ae1b7bdb-65d3-4db0-9ee2-1a888292b22e.mov

Here's a video illustrating no such issues on the same app running on Ember.js 3.21: https://user-images.githubusercontent.com/1195433/144527059-6e3522a2-7da0-40be-850c-45aa2702a9bb.mov

It happened that the _query() method has changes since 3.22 which calls _setIdentifiers instead of _setInternalModels (3.21 and before):

NullVoxPopuli commented 3 years ago

can always ping @runspired :upside_down_face:

waihon commented 3 years ago

Thanks for the suggestion, @NullVoxPopuli!

I have reached out to David Tang, the author of Pro Ember Data.

runspired commented 2 years ago

@waihon did you still need help? There were a few async relationship bugs in 3.28 that have since been patched.