cacheFor returns the wrong value for aliased properties
See original GitHub issueAliased properties (computed.alias, computed.readOnly, etc) return the CONSUMED object when you try to get their cached value.
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
aliased: Ember.computed.alias('appName'),
init() {
this._super(...arguments);
console.log('before:', this.cacheFor('aliased'));
console.log('get:', this.get('aliased'));
console.log('after:', this.cacheFor('aliased'));
}
});
Expected output:
before: undefined
get: Ember Twiddle
after: Ember Twiddle
Actual output:
before: undefined
get: Ember Twiddle
after: Object {}
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Add a system property - Product Documentation | ServiceNow
Set this field to false when you want to ensure all caches have the current property value. The true value causes the system...
Read more >Business data alias cache configuration - IBM
If this property is set to its default value of false, all the processes are searched and the cache is loaded once with...
Read more >NetSuite Applications Suite - URL Component Aliases
Enabling Order Email Messages in NetSuite Connector · Handling Inventory Items with Alias SKU · Viewing Inventory History in NetSuite ...
Read more >Set map service properties—ArcMap | Documentation
This topic examines the properties that you can set for map services through the Service Editor in ArcMap. For a description of the...
Read more >Configuring the Apollo Client cache - Apollo GraphQL Docs
It's sensitive to aliasing mistakes. It does nothing to protect against undefined object properties. Accidentally using different key fields at different times ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Does public API ever distinguish between computed properties and aliases? They’re both created by
Ember.computed. I assumed aliases are a special-case implementation for performance, but they should outwardly behave the same as computed properties@lolmaus according to https://github.com/emberjs/ember.js/issues/15545#issuecomment-317861212 it is working as expected and the issue is a misalignment of expectations. I mean that changing the behaviour of the API this late into the game can bring unexpected surprises.