プロジェクト

全般

プロフィール

バグ #459

完了

request_oauth_tokenに失敗するとmikutterがエラー終了する

Izumi Tsutsui さんが12年以上前に追加. ほぼ11年前に更新.

ステータス:
却下
優先度:
低め
担当者:
-
対象バージョン:
プラグイン名:
change_account.rb
ブランチ:
クラッシュする:

説明

addon/change_account.rb の main での request_oauth_token の処理
request_token = watch.request_oauth_token
でTwitter APIが401を返してくることがあり、その場合 mikutter がエラー終了します。

環境の問題で、ホストの時計が15分程度遅れていると
query_with_oauth で Timestamp out of bounds になり、
再認証でも request_oauth_token で 401 が返ってくるようです。

アクションとしてはリトライするか終了するくらいしかやりようは無い気がしますが、
mikutterのウインドウが開いてすぐ落ちるように見えるので、なにかしら
メッセージウインドウを出して表示したほうがいいような気がします。

時計を20分ずらして起動したときの --debug ログ

notice: {MIKUTTER_DIR}/core/lib/mikutwitter/connect.rb:61:in `query_with_oauth!': Timestamp out of bounds
notice: {MIKUTTER_DIR}/core/addon/list/liststream.rb:40:in `block (2 levels) in start': list stream: connect
notice: {MIKUTTER_DIR}/core/configloader.rb:38:in `block in <module:ConfigLoader>': configloader: wrote 5 keys 
 (UserConfig::tab_position, UserConfig::url_open_specified_command, UserConfig::verify_credentials, UserConfig::extract_tabs, UserConfig::tab_order)
notice: {MIKUTTER_DIR}/core/lib/mikutwitter/query.rb:104:in `ensure in fire_request_event': quit(3): http://api.twitter.com/1/saved_searches.json (16.883333s)
notice: {MIKUTTER_DIR}/core/lib/mikutwitter/query.rb:104:in `ensure in fire_request_event': quit(4): http://api.twitter.com/1/statuses/home_timeline.json (16.874275s)
notice: {MIKUTTER_DIR}/core/lib/mikutwitter/query.rb:104:in `ensure in fire_request_event': quit(1): http://api.twitter.com/1/lists/all.json (17.011919s)
/usr/pkg/share/mikutter/core/lib/oauth/consumer.rb:204:in `token_request': 401 Unauthorized (OAuth::Unauthorized)
        from /usr/pkg/share/mikutter/core/lib/oauth/consumer.rb:128:in `get_request_token'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/connect.rb:27:in `request_oauth_token'
        from /usr/pkg/share/mikutter/core/addon/change_account.rb:95:in `main'
        from /usr/pkg/share/mikutter/core/addon/change_account.rb:37:in `_popup'
        from /usr/pkg/share/mikutter/core/addon/change_account.rb:19:in `block in popup'
        from /usr/pkg/share/mikutter/core/addon/change_account.rb:18:in `new'
        from /usr/pkg/share/mikutter/core/addon/change_account.rb:18:in `popup'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/authentication_failed_action.rb:42:in `call'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/authentication_failed_action.rb:42:in `block in authentication_failed_action'
        from <internal:prelude>:10:in `synchronize'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/authentication_failed_action.rb:41:in `authentication_failed_action'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/connect.rb:64:in `query_with_oauth!'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:81:in `block (4 levels) in _query!'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:102:in `fire_request_event'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:79:in `block (3 levels) in _query!'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:119:in `block in retry_if_fail'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:117:in `times'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:117:in `retry_if_fail'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:78:in `block (2 levels) in _query!'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/cache.rb:17:in `cache'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:77:in `block in _query!'
        from /usr/pkg/lib/ruby/1.9/monitor.rb:201:in `mon_synchronize'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:28:in `api_lock'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:76:in `_query!'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:65:in `query!'
        from /usr/pkg/share/mikutter/core/lib/mikutwitter/query.rb:42:in `block in api'
        from /usr/pkg/share/mikutter/core/lib/deferred/deferred.rb:52:in `call'
        from /usr/pkg/share/mikutter/core/lib/deferred/deferred.rb:52:in `block in initialize'


ファイル

oauth-error-exit.diff (1012 Bytes) oauth-error-exit.diff やっつけパッチ Izumi Tsutsui, 2012-05-02 15:01
mikutter-oauth-401.png (40.9 KB) mikutter-oauth-401.png やっつけウインドウ Izumi Tsutsui, 2012-05-02 15:01

他の形式にエクスポート: Atom PDF