Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

panel: trackedPanels caching issue #10894

Closed
fsmeier opened this issue Sep 11, 2017 · 9 comments · Fixed by #11638
Closed

panel: trackedPanels caching issue #10894

fsmeier opened this issue Sep 11, 2017 · 9 comments · Fixed by #11638
Assignees
Labels
has: Pull Request A PR has been created to address this issue P3: important Important issues that really should be fixed when possible. resolution: fixed type: bug
Milestone

Comments

@fsmeier
Copy link
Contributor

fsmeier commented Sep 11, 2017

Actual Behavior:

  • What is the issue? *
this._trackedPanels[config.id] = panelRef;

config.id is 'undefined' for the first run where no config with id is stored yet.
https://github.com/angular/material/blob/v1.1.5/src/components/panel/panel.js#L1160

  • What is the expected behavior?
    The code should use the id in this._config -> this._config.id

AngularJS Versions: *

  • AngularJS Version: 1.5.x
  • AngularJS Material Version: from the beginning till 1.1.5

Actually this is a bug nobody noticed before and i think it makes no real damage, but it is still a bug.
Before I would make a simple PR I wanted to ask if you see also the problem and if I should make this simple fix the way i described it.

I would like to do my part in stabilizing angularJS material!

Best,
Florian

linking @bradrich as creator of this feature
and @ThomasBurleson as active project-lead of this repo :)

@fsmeier
Copy link
Contributor Author

fsmeier commented Sep 26, 2017

Introduced in #9379 @bradrich

@fsmeier
Copy link
Contributor Author

fsmeier commented Feb 5, 2018

@Splaktar can you label this pls? - I'll try to make a PR the next two weeks.

@Splaktar Splaktar self-assigned this Feb 11, 2018
@Splaktar Splaktar added needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue P5: nice to have These issues will not be fixed without community contributions. severity: inconvenient and removed severity: inconvenient labels Feb 11, 2018
@Splaktar
Copy link
Member

Please provide a CodePen demo where this exception can be observed.

@Splaktar Splaktar added P4: minor Minor issues. May not be fixed without community contributions. and removed P5: nice to have These issues will not be fixed without community contributions. labels Feb 26, 2018
@Splaktar Splaktar added this to the 1.1.8 milestone Feb 26, 2018
@Splaktar
Copy link
Member

@IMM0rtalis is this addressed in #11133? or is this still an issue?

@Splaktar Splaktar added the needs: feedback The issue creator or community need to respond to questions in this issue label Mar 16, 2018
@fsmeier
Copy link
Contributor Author

fsmeier commented Mar 16, 2018

Still an issue, but I think I will not fix this in the next two months. But it is one of my all-time-open-tabs in the browser :D

@Splaktar Splaktar added for: external contributor and removed needs: feedback The issue creator or community need to respond to questions in this issue labels Mar 16, 2018
@Splaktar Splaktar modified the milestones: 1.1.8, - Backlog Mar 16, 2018
@Splaktar Splaktar changed the title mdPanel trackedPanels caching issue panel: trackedPanels caching issue Aug 14, 2018
@Splaktar
Copy link
Member

Splaktar commented Feb 15, 2019

I tried making this change but it breaks 68 tests with Expected 50 to be within 1 of 8 at UserContext or Expected 250 to be within 1 of 8 at UserContext.

For common tests the values of this._config and config are quite different:
For "should retrieve and apply a preset when the preset name is provided during the create or open method",
this._config:

{id: 'panel_0', scope: Scope{$id: 2, $$childTail: null, $$childHead: null, $$prevSibling: null, $$nextSibling: null, $$watchers: null, $parent: Scope{$id: ..., $$childTail: ..., $$childHead: ..., $$prevSibling: ..., $$nextSibling: ..., $$watchers: ..., $parent: ..., $$phase: ..., $root: ..., $$destroyed: ..., $$suspended: ..., $$listeners: ..., $$listenerCount: ..., $$watchersCount: ..., $$isolateBindings: ..., $$asyncQueue: ..., $$postDigestQueue: ..., $$applyAsyncQueue: ...}, $$phase: null, $root: Scope{$id: ..., $$childTail: ..., $$childHead: ..., $$prevSibling: ..., $$nextSibling: ..., $$watchers: ..., $parent: ..., $$phase: ..., $root: ..., $$destroyed: ..., $$suspended: ..., $$listeners: ..., $$listenerCount: ..., $$watchersCount: ..., $$isolateBindings: ..., $$asyncQueue: ..., $$postDigestQueue: ..., $$applyAsyncQueue: ...}, $$destroyed: false, $$suspended: false, $$listeners: Object{$destroy: ...}, $$listenerCount: Object{$destroy: ...}, $$watchersCount: 0, $$isolateBindings: null}, attachTo: Object{0: <div ng-app=""></div>, length: 1}, bindToController: true, clickOutsideToClose: false, disableParentScroll: false, escapeToClose: false, focusOnOpen: true, fullscreen: false, hasBackdrop: false, propagateContainerEvents: false, transformTemplate: function() { ... }, trapFocus: false, zIndex: 80, panelClass: 'preset-container', template: '<div>Hello World!</div>'}

config: {}

For "should create and open a basic panel"
this._config:

{id: 'panel_1', scope: Scope{$id: 4, $$childTail: null, $$childHead: null, $$prevSibling: null, $$nextSibling: null, $$watchers: null, $parent: Scope{$id: ..., $$childTail: ..., $$childHead: ..., $$prevSibling: ..., $$nextSibling: ..., $$watchers: ..., $parent: ..., $$phase: ..., $root: ..., $$destroyed: ..., $$suspended: ..., $$listeners: ..., $$listenerCount: ..., $$watchersCount: ..., $$isolateBindings: ..., $$asyncQueue: ..., $$postDigestQueue: ..., $$applyAsyncQueue: ...}, $$phase: null, $root: Scope{$id: ..., $$childTail: ..., $$childHead: ..., $$prevSibling: ..., $$nextSibling: ..., $$watchers: ..., $parent: ..., $$phase: ..., $root: ..., $$destroyed: ..., $$suspended: ..., $$listeners: ..., $$listenerCount: ..., $$watchersCount: ..., $$isolateBindings: ..., $$asyncQueue: ..., $$postDigestQueue: ..., $$applyAsyncQueue: ...}, $$destroyed: false, $$suspended: false, $$listeners: Object{$destroy: ...}, $$listenerCount: Object{$destroy: ...}, $$watchersCount: 0, $$isolateBindings: null}, attachTo: Object{0: <div ng-app=""></div>, length: 1}, bindToController: true, clickOutsideToClose: false, disableParentScroll: false, escapeToClose: false, focusOnOpen: true, fullscreen: false, hasBackdrop: false, propagateContainerEvents: false, transformTemplate: function() { ... }, trapFocus: false, zIndex: 80, template: '<div>Hello World!</div>'}

config: {template: '<div>Hello World!</div>'}

@Splaktar
Copy link
Member

There is certainly something funky here.

'this._config.id: panel_2'
'config.id: undefined'

'this._config.id: panel_0'
'config.id: undefined'

'this._config.id: panel_26'
'config.id: undefined'

this._trackedPanels[undefined] = panelRef; seems to be passing the tests but something like this._trackedPanels['panel_0'] = panelRef; causes failures.

@Splaktar Splaktar removed the needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue label Feb 15, 2019
@Splaktar
Copy link
Member

Ugh, it looks like my build or browser cache got broken somehow. I cleared and restarted things and now this change isn't causing failures. 😕

@Splaktar
Copy link
Member

Splaktar commented Feb 15, 2019

It looks like this caching was working for tooltips (config.id === md-tooltip-1746), but not panels (config.id === undefinfed).

'this._config.id: panel_978'
'config.id: undefined'
'this._config.id: panel_979'
'config.id: undefined'
'this._config.id: md-tooltip-1720'
'config.id: md-tooltip-1720'
'this._config.id: md-tooltip-1721'
'config.id: md-tooltip-1721'

@Splaktar Splaktar modified the milestones: - Backlog, 1.1.14 Feb 15, 2019
@Splaktar Splaktar added type: bug has: Pull Request A PR has been created to address this issue labels Feb 15, 2019
@Splaktar Splaktar added P3: important Important issues that really should be fixed when possible. and removed for: external contributor P4: minor Minor issues. May not be fixed without community contributions. labels Feb 15, 2019
Splaktar added a commit that referenced this issue Feb 15, 2019
it worked for tooltips but not panels

Fixes #10894
@Splaktar Splaktar modified the milestones: 1.1.14, g3: sync Feb 15, 2019
@Splaktar Splaktar modified the milestones: g3: sync, 1.1.14 Mar 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P3: important Important issues that really should be fixed when possible. resolution: fixed type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants