Merge lp:~mandel/ubuntuone-windows-installer/fix_multithreading into lp:ubuntuone-windows-installer/beta

Proposed by Manuel de la Peña
Status: Merged
Approved by: Stuart Colville
Approved revision: 73
Merged at revision: 80
Proposed branch: lp:~mandel/ubuntuone-windows-installer/fix_multithreading
Merge into: lp:ubuntuone-windows-installer/beta
Prerequisite: lp:~mandel/ubuntuone-windows-installer/fix_xp_paths
Diff against target: 211 lines (+72/-36)
5 files modified
RELEASE_NOTES.txt (+19/-0)
src/Canonical.UbuntuOne.Client.Views/Update/DownloadingView.xaml.cs (+19/-17)
src/Canonical.UbuntuOne.Common.Tests/Update/UpdatingPresenterFixture.cs (+16/-9)
src/Canonical.UbuntuOne.Common/Update/Updater.cs (+2/-3)
src/Canonical.UbuntuOne.Common/Update/UpdatingPresenter.cs (+16/-7)
To merge this branch: bzr merge lp:~mandel/ubuntuone-windows-installer/fix_multithreading
Reviewer Review Type Date Requested Status
Stuart Colville (community) Approve
Rick McBride (community) Approve
Review via email: mp+34413@code.launchpad.net

Description of the change

Fixes the issue related with the fact that the ui elements are created in a different thread.

To post a comment you must log in.
Revision history for this message
Stuart Colville (muffinresearch) wrote :

I get a test failure for this: https://pastebin.canonical.com/36643/

Revision history for this message
Rick McBride (rmcbride) wrote :

Build fails for me in the same way as Stuart reported.

review: Needs Fixing
Revision history for this message
Manuel de la Peña (mandel) wrote :

Sorry, mea culpa, I changed the way the multithreading works and the tests are failing, I'm on my way to fix it.

71. By Manuel de la Peña

Fixed issues with the tests that were not modify to follow the new multithreading style.

72. By Manuel de la Peña

Updated release notes.

Revision history for this message
Rick McBride (rmcbride) wrote :

tests pass now

review: Approve
73. By Manuel de la Peña

Updated release notes

Revision history for this message
Stuart Colville (muffinresearch) wrote :

Tests pass +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'RELEASE_NOTES.txt'
2--- RELEASE_NOTES.txt 1970-01-01 00:00:00 +0000
3+++ RELEASE_NOTES.txt 2010-09-02 15:23:39 +0000
4@@ -0,0 +1,19 @@
5+RELEASE HISTORY
6+
7+September 02 2010 • Ubuntu One Windows Port 1.0.502.6037
8+
9+Bug fixes:
10+
11+ 626702 - The storage protocol certificates are not correctly distributed
12+ https://bugs.edge.launchpad.net/ubuntuone-windows-installer/+bug/626702
13+ 626899 - UbuntuOne installer offers too many options
14+ https://bugs.edge.launchpad.net/ubuntuone-windows-installer/+bug/626899
15+ 626889 - Installer shows CPL, but Ubuntu One is GPL.
16+ https://bugs.edge.launchpad.net/ubuntuone-windows-installer/+bug/626889
17+ 627930 - The checksum from the updates is not correctly verified
18+ https://bugs.edge.launchpad.net/ubuntuone-windows-installer/+bug/627930
19+ 628693 - Ubuntu One sync fails on Windows XP because the paths are not quoted
20+ https://bugs.edge.launchpad.net/ubuntuone-windows-installer/+bug/628693
21+ 628759 - When an update is available it cannot be performed because the UI element
22+ was created in a different thread
23+ https://bugs.edge.launchpad.net/ubuntuone-windows-installer/+bug/628759
24\ No newline at end of file
25
26=== modified file 'lib/DotUpdater/DotUpdater.dll'
27Binary files lib/DotUpdater/DotUpdater.dll 2010-09-02 09:25:13 +0000 and lib/DotUpdater/DotUpdater.dll 2010-09-02 15:23:39 +0000 differ
28=== modified file 'lib/DotUpdater/DotUpdater.pdb'
29Binary files lib/DotUpdater/DotUpdater.pdb 2010-09-02 09:25:13 +0000 and lib/DotUpdater/DotUpdater.pdb 2010-09-02 15:23:39 +0000 differ
30=== modified file 'src/Canonical.UbuntuOne.Client.Views/Update/DownloadingView.xaml.cs'
31--- src/Canonical.UbuntuOne.Client.Views/Update/DownloadingView.xaml.cs 2010-08-19 16:57:06 +0000
32+++ src/Canonical.UbuntuOne.Client.Views/Update/DownloadingView.xaml.cs 2010-09-02 15:23:39 +0000
33@@ -1,20 +1,22 @@
34-// Copyright 2010 Canonical Ltd.
35-//
36-// This file is part of UbuntuOne on Windows.
37-//
38-// UbuntuOne on Windows is free software: you can redistribute it and/or modify
39-// it under the terms of the GNU Lesser General Public License version
40-// as published by the Free Software Foundation.
41-//
42-// Ubuntu One on Windows is distributed in the hope that it will be useful,
43-// but WITHOUT ANY WARRANTY; without even the implied warranty of
44-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45-// GNU Lesser General Public License for more details.
46-//
47-// You should have received a copy of the GNU Lesser General Public License
48-// along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
49-//
50-// Authors: Manuel de la Peña <manuel.delapena@canonical.com>
51+/*
52+ * Copyright 2010 Canonical Ltd.
53+ *
54+ * This file is part of UbuntuOne on Windows.
55+ *
56+ * UbuntuOne on Windows is free software: you can redistribute it and/or modify
57+ * it under the terms of the GNU Lesser General Public License version
58+ * as published by the Free Software Foundation.
59+ *
60+ * Ubuntu One on Windows is distributed in the hope that it will be useful,
61+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
62+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63+ * GNU Lesser General Public License for more details.
64+ *
65+ * You should have received a copy of the GNU Lesser General Public License
66+ * along with UbuntuOne for Windows. If not, see <http://www.gnu.org/licenses/>.
67+ *
68+ * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
69+ */
70 using System;
71 using Canonical.UbuntuOne.Common.Threading;
72 using Canonical.UbuntuOne.Common.Update;
73
74=== modified file 'src/Canonical.UbuntuOne.Common.Tests/Update/UpdatingPresenterFixture.cs'
75--- src/Canonical.UbuntuOne.Common.Tests/Update/UpdatingPresenterFixture.cs 2010-07-29 16:38:26 +0000
76+++ src/Canonical.UbuntuOne.Common.Tests/Update/UpdatingPresenterFixture.cs 2010-09-02 15:23:39 +0000
77@@ -18,6 +18,7 @@
78 * Authors: Manuel de la Peña <manuel.delapena@canonical.com>
79 */
80
81+using Canonical.UbuntuOne.Common.Threading;
82 using Canonical.UbuntuOne.Common.Update;
83 using NUnit.Framework;
84 using Rhino.Mocks;
85@@ -32,6 +33,7 @@
86 private MockRepository _mocks;
87 private IUpdatingView _view;
88 private UpdatingPresenter _presenter;
89+ private IDispatcher _dispatcher;
90
91 #endregion
92
93@@ -42,6 +44,7 @@
94 {
95 _mocks = new MockRepository();
96 _view = _mocks.StrictMock<IUpdatingView>();
97+ _dispatcher = _mocks.StrictMock<IDispatcher>();
98 _presenter = new UpdatingPresenter
99 {
100 View = _view
101@@ -59,8 +62,10 @@
102 {
103 SetupResult.For(_view.IsShown)
104 .Return(true);
105- _view.UpdatingText = UpdateResources.UpdateStarted;
106- _view.IsUpdating = true;
107+ SetupResult.For(_view.ViewDispatcher)
108+ .Return(_dispatcher);
109+ Expect.Call(() => _dispatcher.Dispatch(null))
110+ .IgnoreArguments();
111 }
112 using(_mocks.Playback())
113 {
114@@ -75,11 +80,11 @@
115 {
116 SetupResult.For(_view.IsShown)
117 .Return(false);
118- Expect.Call(() => _view.Show())
119- .Repeat.Once();
120-
121- _view.UpdatingText = UpdateResources.UpdateStarted;
122- _view.IsUpdating = true;
123+ SetupResult.For(_view.ViewDispatcher)
124+ .Return(_dispatcher);
125+ Expect.Call(() => _dispatcher.Dispatch(null))
126+ .IgnoreArguments()
127+ .Repeat.Twice();
128 }
129 using (_mocks.Playback())
130 {
131@@ -92,8 +97,10 @@
132 {
133 using (_mocks.Record())
134 {
135- _view.UpdatingText = UpdateResources.UpdateFinished;
136- _view.IsUpdating = false;
137+ SetupResult.For(_view.ViewDispatcher)
138+ .Return(_dispatcher);
139+ Expect.Call(() => _dispatcher.Dispatch(null))
140+ .IgnoreArguments();
141 }
142 using (_mocks.Playback())
143 {
144
145=== modified file 'src/Canonical.UbuntuOne.Common/Update/Updater.cs'
146--- src/Canonical.UbuntuOne.Common/Update/Updater.cs 2010-08-19 16:57:06 +0000
147+++ src/Canonical.UbuntuOne.Common/Update/Updater.cs 2010-09-02 15:23:39 +0000
148@@ -141,8 +141,7 @@
149 {
150 Logger.Info(UpdateResources.DownloadCompleted);
151 // call the method in an other thread that will perform the update
152- UpdaterDelegate updaterDelegate = UpdateDownloadedMainThread;
153- Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, updaterDelegate, e.Task);
154+ UpdateDownloadedMainThread(e.Task);
155 }
156
157 /// <summary>
158@@ -154,7 +153,7 @@
159 private void DownloadErrorHandler(object sender, DownloadTaskErrorEventArgs args)
160 {
161 Logger.Error(args.Exception.Message);
162- //throw new SelfUpdateException(UpdateResources.DownloadError, args.Exception);
163+ throw new SelfUpdateException(UpdateResources.DownloadError, args.Exception);
164 }
165
166 /// <summary>
167
168=== modified file 'src/Canonical.UbuntuOne.Common/Update/UpdatingPresenter.cs'
169--- src/Canonical.UbuntuOne.Common/Update/UpdatingPresenter.cs 2010-08-05 07:13:28 +0000
170+++ src/Canonical.UbuntuOne.Common/Update/UpdatingPresenter.cs 2010-09-02 15:23:39 +0000
171@@ -1,4 +1,4 @@
172-/**
173+/*
174 * Copyright 2010 Canonical Ltd.
175 *
176 * This file is part of UbuntuOne on Windows.
177@@ -36,10 +36,15 @@
178 /// </summary>
179 public void UpdatingStarted()
180 {
181- if(!View.IsShown)
182- View.Show();
183- View.UpdatingText = UpdateResources.UpdateStarted;
184- View.IsUpdating = true;
185+ if (!View.IsShown)
186+ View.ViewDispatcher.Dispatch(() => View.Show());
187+ View.ViewDispatcher.Dispatch(
188+ () =>
189+ {
190+ View.UpdatingText = UpdateResources.UpdateStarted;
191+ View.IsUpdating = true;
192+ });
193+
194 }
195
196 /// <summary>
197@@ -47,8 +52,12 @@
198 /// </summary>
199 public void UpdatingFinished()
200 {
201- View.UpdatingText = UpdateResources.UpdateFinished;
202- View.IsUpdating = false;
203+ View.ViewDispatcher.Dispatch(
204+ () =>
205+ {
206+ View.UpdatingText = UpdateResources.UpdateFinished;
207+ View.IsUpdating = false;
208+ });
209 }
210 }
211 }

Subscribers

People subscribed via source and target branches

to all changes: