Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2456)

Issue 7199043: Fix error while removing relations.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by frankban
Modified:
11 years, 3 months ago
Reviewers:
mp+144484
Visibility:
Public.

Description

Fix error while removing relations. When removing a relation sometimes an exception is raised: "Uncaught TypeError: Cannot call method 'one' of null". I was able to reproduce the bug following these steps: 1) click on a relation, the remove relation modal dialog appears; 2) open the GUI in another tab, and force a delta stream event (e.g. add/remove another relation, destroy a service...); 3) on delta, the relation nodes are redrawn on both tabs, so the element stored in the dialog no longer exists in the DOM; 4) on the first tab, click to confirm the relation removal, you'll see the error. In this branch, the relation node is retrieved again in removeRelation using its relation id. This way we ensure the element actually exists in the DOM. https://code.launchpad.net/~frankban/juju-gui/bug-1103204-remove-relation/+merge/144484 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Fix error while removing relations. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M app/views/topology/relation.js View 2 chunks +7 lines, -4 lines 0 comments Download

Messages

Total messages: 4
frankban
Please take a look.
11 years, 3 months ago (2013-01-23 12:26:22 UTC) #1
bac
Looks good to land Francesco. Nice work figuring it out.
11 years, 3 months ago (2013-01-23 12:31:34 UTC) #2
benji
The branch looks good. It would be good to have a test that ensures the ...
11 years, 3 months ago (2013-01-23 13:54:24 UTC) #3
frankban
11 years, 3 months ago (2013-01-23 14:06:41 UTC) #4
*** Submitted:

Fix error while removing relations.

When removing a relation sometimes an exception 
is raised: "Uncaught TypeError: Cannot call method 
'one' of null".
I was able to reproduce the bug following these steps:
1) click on a relation, the remove relation modal 
   dialog appears;
2) open the GUI in another tab, and force a delta stream
   event (e.g. add/remove another relation, 
   destroy a service...);
3) on delta, the relation nodes are redrawn on both tabs,
   so the element stored in the dialog no longer exists
   in the DOM;
4) on the first tab, click to confirm the relation removal,
   you'll see the error.
In this branch, the relation node is retrieved again in
removeRelation using its relation id. This way we ensure
the element actually exists in the DOM.

R=bac, benji
CC=
https://codereview.appspot.com/7199043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b