Action services retain state, and should not

Bug #1640049 reported by Richard Jones
6
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/345145
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=f9b3bc7b2baeefbeafd810f285c692f6dad3983b
Submitter: Jenkins
Branch: master

commit f9b3bc7b2baeefbeafd810f285c692f6dad3983b
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: Ieb293d0a849cd84d15e7aae0a68558fde80fd2c2
    Fixes-Bug: 1640049

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/498741
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=9a758638ee61c56b46f47782c8bfd448cbe3e387
Submitter: Zuul
Branch: master

commit 9a758638ee61c56b46f47782c8bfd448cbe3e387
Author: Shu Muto <email address hidden>
Date: Tue Aug 29 19:09:36 2017 +0900

    Remove deprecated scope handling

    The `initScope` function is deprecated since ocata, so this patch
    replaces it into `initAction` if it needed, or removes it.
    Also, gets scope from second parameter of perform function.
    Futher more, removes deprecated `scope` parameter for `modal`
    function of wizard-modal-service.

    Change-Id: I8979b699a9b4383b894db9bdcbad80f15c1df150
    Closes-Bug: #1640049

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (master)

Reviewed: https://review.openstack.org/493538
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=7b207fbf89b97a8bc9be3469a2a4a442f6c2c2e2
Submitter: Zuul
Branch: master

commit 7b207fbf89b97a8bc9be3469a2a4a442f6c2c2e2
Author: Lajos Katona <email address hidden>
Date: Mon Aug 14 14:59:12 2017 +0200

    Remove initScope from trunk delete.action.service

    The initScope method is deprecated, the action service should be
    stateless.

    Also refactor to simplify delete action logic. Some code got carried
    over from the images panel, what we originally used as an example. But
    much of that code was doing checks useless for trunks. Trunks don't have
    complicated 'public' and 'shared' attributes controlling who can operate
    on them. A simple policy check will suffice.

    Co-Authored-By: Bence Romsics <email address hidden>
    Change-Id: I689a98697d997780af42eb31a4b5eeee2ddf9b0f
    Partially-Implements: blueprint neutron-trunk-ui
    Related-Bug: #1640049

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.0.0b2

This issue was fixed in the openstack/horizon 13.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.