ember-simple-auth icon indicating copy to clipboard operation
ember-simple-auth copied to clipboard

`data` computed property on session service not always receiving content update notification

Open nickschot opened this issue 4 years ago • 0 comments

In multiple locations in the internal-session a deep setter is used to update content.authenticated. This means no "update" notification happens on the content property itself, only on content.authenticated. In practice this means the data computed property on the session service does not always update correctly when it is updated.

Example of the setter: https://github.com/simplabs/ember-simple-auth/blob/3f2f60332c629f4c32743e681032bd8ea79428ce/packages/ember-simple-auth/addon/internal-session.js#L96-L100

A possible solution would be to set the entire content property, or to call notifyPropertyChange on the content property. The former is probably a more future proof solution if a refactor of internal-session ever happens with regards to tracked properties etc.

nickschot avatar Jan 15 '21 12:01 nickschot