sys1yagi / mastodon4j

mastodon client for java, kotlin https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md
MIT License
135 stars 28 forks source link

Streaming bug fix.(data missing , I/O exception occurred when shutdown.) #58

Closed hero-matsumoto closed 6 years ago

hero-matsumoto commented 6 years ago

・受信データは、event: <<種別>>、data:<<データ内容>>、 以外に :thump というのが時々送られてきているため、元のロジックではその次のデータを読み飛ばしてしまっていました。 これを読み飛ばさないように、また少しだけ確実にデータ取得が出来るように微調整しました。

・ストリーミングをShutdownable.shutdown()メソッドで終了させたとき、reader.readLine() で例外が発生して落ちていたので、キャッチして受信ループを終了させてbufferedReaderをclose()するようにしました。

codecov-io commented 6 years ago

Codecov Report

Merging #58 into master will decrease coverage by 4%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #58      +/-   ##
============================================
- Coverage     58.25%   54.25%   -4.01%     
  Complexity      147      147              
============================================
  Files            44       44              
  Lines           745      800      +55     
  Branches         60       80      +20     
============================================
  Hits            434      434              
- Misses          297      352      +55     
  Partials         14       14
Impacted Files Coverage Δ Complexity Δ
...ain/java/com/sys1yagi/mastodon4j/api/Dispatcher.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...va/com/sys1yagi/mastodon4j/api/method/Streaming.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 57d6fc8...88e4de1. Read the comment docs.

sys1yagi commented 6 years ago

👀 sorry, I missed it. I'll review it soon.

hero-matsumoto commented 6 years ago

Thanks!!