Action services retain state, and should not
Bug #1640049 reported by
Richard Jones
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
High
|
Richard Jones |
Bug Description
AngularJS services are singletons, so storing state on them is dangerous (using the same service twice in a single context will result in that state data being indeterminate).
Changed in horizon: | |
milestone: | none → ocata-1 |
importance: | Undecided → High |
status: | New → Triaged |
assignee: | nobody → Richard Jones (r1chardj0n3s) |
Changed in horizon: | |
status: | Triaged → In Progress |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/345145 /git.openstack. org/cgit/ openstack/ horizon/ commit/ ?id=f9b3bc7b2ba eefbeafd810f285 c692f6dad3983b
Committed: https:/
Submitter: Jenkins
Branch: master
commit f9b3bc7b2baeefb eafd810f285c692 f6dad3983b
Author: Richard Jones <email address hidden>
Date: Thu Jul 21 13:39:27 2016 +1000
Remove use of scope from action service
The scope being handed to (and retained on) the action
service was being used for two purposes:
1. handing data down to the underlying wizard steps, and
2. receiving data back from the underlying wizard steps.
This patch provides a mechanism for passing data down through
injection, and removes the need for event-based data return
by explicitly passing the captured wizard data to the submit()
resolution.
It also adds the controller scope to the allowed() and
perform() action service handlers to grant access to
contextual information without needing to attach state
to the service.
Change-Id: Ieb293d0a849cd8 4d15e7aae0a6855 8fde80fd2c2
Fixes-Bug: 1640049