Project

General

Profile

致命的 #908

display_requirements が有効なとき、(あん)ふぁぼられると落ちる

Added by rhen ium almost 3 years ago. Updated almost 3 years ago.

Status:
終了
Priority:
通常
Assignee:
Target version:
Start date:
2016-10-07
Due date:
% Done:

0%

プラグイン名:

Description

display_requirements プラグインを無効にして起動していたらこんな例外で落ちました

/home/k/mikutter/core/plugin/display_requirements/display_requirements.rb:90:in `block (2 levels) in <top (required)>': no implicit conversion of URI::HTTPS into String (TypeError)
[Thread 0x7fffbfd7d700 (LWP 28756) exited]
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/listener.rb:25:in `call'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:97:in `block (2 levels) in call_all_listeners'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:96:in `each'
[Thread 0x7fff97dfd700 (LWP 24180) exited]
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:96:in `block in call_all_listeners'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:95:in `catch'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:95:in `call_all_listeners'
[Thread 0x7ffff154a700 (LWP 24178) exited]
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:45:in `block (2 levels) in call'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer/procedure.rb:24:in `run'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer/extend.rb:58:in `run_once'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer/extend.rb:30:in `run'
    from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer.rb:43:in `method_missing'
    from /home/k/mikutter/core/plugin/gtk/delayer.rb:10:in `block in boot'
    from /home/k/mikutter/core/plugin/gtk/mainloop.rb:10:in `main'
    from /home/k/mikutter/core/plugin/gtk/mainloop.rb:10:in `mainloop'
    from ./mikutter.rb:65:in `boot!'
    from ./mikutter.rb:94:in `<main>'

Message#perma_link が URI を返すようになった(?)影響のようなので、とりあえず文字列化してやれば動くようにはなります

diff --git a/core/plugin/display_requirements/display_requirements.rb b/core/plugin/display_requirements/display_requirements.rb
index f9c4369..7493749 100644
--- a/core/plugin/display_requirements/display_requirements.rb
+++ b/core/plugin/display_requirements/display_requirements.rb
@@ -87,7 +87,7 @@ Plugin.create :display_requirements do
     activity(:like, "#{message.user[:idname]}: #{message.to_s}",
              description:(_("@%{user} がいいねいいねしました") % {user: user[:idname]} + "\n" +
                           "@#{message.user[:idname]}: #{message.to_s}\n"+
-                          message.perma_link),
+                          message.perma_link.to_s),
              icon: user[:profile_image_url],
              related: message.user.me? || user.me?,
              service: service)
@@ -97,7 +97,7 @@ Plugin.create :display_requirements do
     activity(:dont_like, "#{message.user[:idname]}: #{message.to_s}",
              description:(_("@%{user} があんいいねしました") % {user: user[:idname]} + "\n" +
                           "@#{message.user[:idname]}: #{message.to_s}\n"+
-                          message.perma_link),
+                          message.perma_link.to_s),
              icon: user[:profile_image_url],
              related: message.user.me? || user.me?,
              service: service)

バックトレース

/home/k/mikutter/core/plugin/display_requirements/display_requirements.rb:90:in `block (2 levels) in <top (required)>': no implicit conversion of URI::HTTPS into String (TypeError)
[Thread 0x7fffbfd7d700 (LWP 28756) exited]
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/listener.rb:25:in `call'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:97:in `block (2 levels) in call_all_listeners'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:96:in `each'
[Thread 0x7fff97dfd700 (LWP 24180) exited]
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:96:in `block in call_all_listeners'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:95:in `catch'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:95:in `call_all_listeners'
[Thread 0x7ffff154a700 (LWP 24178) exited]
from /opt/ruby/lib/ruby/gems/2.4.0/gems/pluggaloid-1.1.1/lib/pluggaloid/event.rb:45:in `block (2 levels) in call'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer/procedure.rb:24:in `run'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer/extend.rb:58:in `run_once'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer/extend.rb:30:in `run'
from /opt/ruby/lib/ruby/gems/2.4.0/gems/delayer-0.0.2/lib/delayer.rb:43:in `method_missing'
from /home/k/mikutter/core/plugin/gtk/delayer.rb:10:in `block in boot'
from /home/k/mikutter/core/plugin/gtk/mainloop.rb:10:in `main'
from /home/k/mikutter/core/plugin/gtk/mainloop.rb:10:in `mainloop'
from ./mikutter.rb:65:in `boot!'
from ./mikutter.rb:94:in `<main>'

Associated revisions

Revision 520fc999 (diff)
Added by toshi_a 初音 almost 3 years ago

We love developers. refs #908

History

#1

Updated by toshi_a 初音 almost 3 years ago

やはりいいねなんてなかったんや…(そうじゃない

#2

Updated by toshi_a 初音 almost 3 years ago

  • Status changed from 新規 to 実装待ち
  • Assignee set to toshi_a 初音
#3

Updated by toshi_a 初音 almost 3 years ago

  • Tracker changed from バグ to 致命的
  • バックトレース updated (diff)
#4

Updated by toshi_a 初音 almost 3 years ago

  • Status changed from 実装待ち to レビュー待ち
  • Assignee changed from toshi_a 初音 to rhen ium

String#+でくっつけるの微妙だなあと思ったので別の方法を使いました。この辺は多分3.5で大幅に変わってくるんでどっちでも良かったかもですが。
こちらでも問題の再現と、fixの確認できたので、一応見てもらっていいですか

#5

Updated by rhen ium almost 3 years ago

  • Status changed from レビュー待ち to まだダメ
  • Assignee changed from rhen ium to toshi_a 初音

落ちなくなったことは確認しましたが、もともと message.user[:idname] だったところが user[:idname] になっていて、意味が変わってしまっています。

#6

Updated by toshi_a 初音 almost 3 years ago

アッ(帰ったら直します…

#7

Updated by toshi_a 初音 almost 3 years ago

  • Status changed from まだダメ to レビュー待ち
  • Assignee changed from toshi_a 初音 to rhen ium

なおした

#8

Updated by rhen ium almost 3 years ago

  • Status changed from レビュー待ち to 終了

直ってました。

Also available in: Atom PDF