[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: Review Request 125376: KNotification: don't update notification twice
From: "Igor Poboiko" <igor.poboiko () gmail ! com>
Date: 2015-09-24 17:10:26
Message-ID: 20150924171026.14939.46195 () mimi ! kde ! org
[Download RAW message or body]
--===============7319685031926898666==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
> On Сен. 24, 2015, 3:56 п.п., Martin Klapetek wrote:
> > Thanks for the patch. Is it reproducible with anything else? Also, can you point \
> > me to the ktp code in question?
> > Thanks
It's [ktp-approver/textchannelapprover.cpp](https://quickgit.kde.org/?p=ktp-approver.g \
it&a=blob&h=b28db461f539c8218b8787ad637c7925ad28b5aa&hb=15c82c42262bc95d014ab65531ede0d97c44a29b&f=src%2Ftextchannelapprover.cpp), \
TextChannelApprover::onMessageReceived(). I'm not sure where can I test it, since KTp \
might be the only thing which produces notifications and then tries to reuse it (not \
sure about it). Any suggestions?
If you think it's worth it, I can try write a simple few-line program and try to \
reproduce it.
> On Сен. 24, 2015, 3:56 п.п., Martin Klapetek wrote:
> > src/knotification.cpp, lines 429-430
> > <https://git.reviewboard.kde.org/r/125376/diff/1/?file=405175#file405175line429>
> >
> > {}s around ifs
Right, even in one-line patch I made a mistake X_X
Old habits die slowly and painfully...
- Igor
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125376/#review85875
-----------------------------------------------------------
On Сен. 24, 2015, 3:49 п.п., Igor Poboiko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125376/
> -----------------------------------------------------------
>
> (Updated Сен. 24, 2015, 3:49 п.п.)
>
>
> Review request for Plasma and Martin Klapetek.
>
>
> Repository: knotifications
>
>
> Description
> -------
>
> I've noted a bug when using KDE Telepathy: if I receive 2 new messages, first \
> creates a new notification, and second is being duplicated (see screenshot \
> attached; on it I just wrote myself "hello", then "world").
> Investigation showed following:
> * KTp calls KNotification::setText on existing notification
> * KNotification starts d->updateTimer, which will update notification in 100 msec
> * KTp call KNotification::sendEvent, which updates notification
> * updateTimer expires calling KNotification::update() again, leading to duplicated \
> DBus message and duplicated notification
> Not sure if there is any bug in BugZilla, but it is 100% reproducible in my case.
>
>
> Diffs
> -----
>
> src/knotification.cpp cf09e63
>
> Diff: https://git.reviewboard.kde.org/r/125376/diff/
>
>
> Testing
> -------
>
> After applying patch it works fine.
>
>
> File Attachments
> ----------------
>
> The problem
> https://git.reviewboard.kde.org/media/uploaded/files/2015/09/24/161f9955-068a-4b39-85d0-8537b05d9cb2__snapshot22.png
>
>
> Thanks,
>
> Igor Poboiko
>
>
--===============7319685031926898666==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/125376/">https://git.reviewboard.kde.org/r/125376/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On Сентябрь 24th, 2015, 3:56 п.п. UTC, \
<b>Martin Klapetek</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: \
2px solid #d0d0d0; padding-left: 10px;"> <pre style="white-space: pre-wrap; \
white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; \
word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">Thanks for the patch. Is it \
reproducible with anything else? Also, can you point me to the ktp code in \
question?</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Thanks</p></pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It's \
<a href="https://quickgit.kde.org/?p=ktp-approver.git&a=blob&h=b28db461f539c82 \
18b8787ad637c7925ad28b5aa&hb=15c82c42262bc95d014ab65531ede0d97c44a29b&f=src%2Ftextchannelapprover.cpp" \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
normal;">ktp-approver/textchannelapprover.cpp</a>, \
TextChannelApprover::onMessageReceived(). I'm not sure where can I test it, since KTp \
might be the only thing which produces notifications and then tries to reuse it (not \
sure about it). Any suggestions?</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">If you think it's worth \
it, I can try write a simple few-line program and try to reproduce it.</p></pre> <br \
/>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On Сентябрь 24th, 2015, 3:56 п.п. UTC, \
<b>Martin Klapetek</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: \
2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/125376/diff/1/?file=405175#file405175line429" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/knotification.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">QString KNotification::appName() const</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">429</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KNotificationManager</span><span class="o">::</span><span \
class="n">self</span><span class="p">()</span><span class="o">-></span><span \
class="n">update</span><span class="p">(</span><span class="k">this</span><span \
class="p">);</span></pre></td> <th bgcolor="#e9eaa8" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">429</font></th> <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span \
class="p">(</span><span class="n">d</span><span class="o">-></span><span \
class="n">needUpdate</span><span class="p">)</span></pre></td> </tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">430</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KNotificationManager</span><span class="o">::</span><span \
class="n">self</span><span class="p">()</span><span class="o">-></span><span \
class="n">update</span><span class="p">(</span><span class="k">this</span><span \
class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">{}s \
around ifs</p></pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Right, even in one-line patch I made a mistake X_X Old habits die slowly \
and painfully...</p></pre> <br />
<p>- Igor</p>
<br />
<p>On Сентябрь 24th, 2015, 3:49 п.п. UTC, Igor Poboiko wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for Plasma and Martin Klapetek.</div>
<div>By Igor Poboiko.</div>
<p style="color: grey;"><i>Updated Сен. 24, 2015, 3:49 п.п.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
knotifications
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I've noted a bug when using KDE Telepathy: if I \
receive 2 new messages, first creates a new notification, and second is being \
duplicated (see screenshot attached; on it I just wrote myself "hello", then \
"world").</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Investigation showed following:
* KTp calls KNotification::setText on existing notification
* KNotification starts d->updateTimer, which will update notification in 100 msec
* KTp call KNotification::sendEvent, which updates notification
* updateTimer expires calling KNotification::update() again, leading to duplicated \
DBus message and duplicated notification</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Not sure if there is \
any bug in BugZilla, but it is 100% reproducible in my case.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">After applying patch it works fine.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/knotification.cpp <span style="color: grey">(cf09e63)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/125376/diff/" style="margin-left: \
3em;">View Diff</a></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments \
</h1>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2015/09/24/161f9955-068a-4b39-85d0-8537b05d9cb2__snapshot22.png">The \
problem</a></li>
</ul>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============7319685031926898666==--
[Attachment #3 (text/plain)]
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic