senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. zunda ? nはおまけ :green_dango: (zundan@mastodon.zunda.ninja@mastodon.zunda.ninja)'s status on Monday, 21-Jan-2019 12:41:59 JST zunda ? nはおまけ :green_dango: zunda ? nはおまけ :green_dango:

    tootctl accounts refresh ユーザー名@ドメインで走るのは、lib/mastodon/accounts_cli.rbよりMaintenance::RedownloadAccountMediaWorker.perform_async。app/workers/maintenance/redownload_account_media_worker.rbより、account.reset_avatar!、account.reset_header!、account.saveが順に呼ばれる。

    しかし、reset_avatar!の定義はどこだ?git grep reset_avatarしても結果が得られない。また、irbから走らせてもすぐ完了するのでリクエストを送っているようにも見えない。手元にアバターが無い例:

    ~ $ rails c
    > a = Account.find_remote('zundan', 'mstdn.jp')
    > a.avatar_updated_at
    => nil
    > a.reset_avatar!
    => nil
    > a.avatar_updated_at
    => nil

    手元にアバターが有る例:

    > a = Account.find_remote('ユーザー名', 'mstdn.jp')
    > a.avatar_updated_at
    => Sat, 29 Apr 2017 06:55:28 UTC +00:00
    > a.reset_avatar!
    => nil
    > a.avatar_updated_at
    => Sat, 29 Apr 2017 06:55:28 UTC +00:00
    > a.avatar_updated_at = nil
    > a.reset_avatar!
    > a.avatar_updated_at
    => nil

    In conversation Monday, 21-Jan-2019 12:41:59 JST from mastodon.zunda.ninja permalink
    • zunda ? nはおまけ :green_dango: (zundan@mastodon.zunda.ninja@mastodon.zunda.ninja)'s status on Monday, 21-Jan-2019 13:15:22 JST zunda ? nはおまけ :green_dango: zunda ? nはおまけ :green_dango:
      in reply to

      reset_avatar!の定義を探す

      https://qiita.com/jnchito/items/fc8a61b421d026a23ffe

      > a = Account.find_remote('zundan', 'mstdn.jp')
      > a.method(:reset_avatar!).source_location
      => ["/app/app/models/concerns/remotable.rb", 53]

      おぉ!こりゃ便利。app/models/concerns/remotable.rb はメタプログラミングな感じで読みにくいんだけど、これを読めば何が期待通りに動いてないのかわかる感じ。

      In conversation Monday, 21-Jan-2019 13:15:22 JST permalink
    • zunda ? nはおまけ :green_dango: (zundan@mastodon.zunda.ninja@mastodon.zunda.ninja)'s status on Monday, 21-Jan-2019 14:52:44 JST zunda ? nはおまけ :green_dango: zunda ? nはおまけ :green_dango:
      in reply to

      ふむ。このインスタンスでアバターが見えていないmstdn.jpのアカウントについては、 https://github.com/zunda/mastodon/blob/5b2b493a908cbea55096f7f028c306f6270e3b00/app/models/concerns/remotable.rb#L13 で url が nil になっている。アバターの見えているアカウントについては、 https://media.mstdn.jp/accounts/avatars/???/???/???/original/????????????????.png の形式のURLとなっている。

      In conversation Monday, 21-Jan-2019 14:52:44 JST permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: avatars3.githubusercontent.com
        zunda/mastodon
        from GitHub
        A GNU Social-compatible microblogging server. Contribute to zunda/mastodon development by creating an account on GitHub.

    • zunda ? nはおまけ :green_dango: (zundan@mastodon.zunda.ninja@mastodon.zunda.ninja)'s status on Monday, 21-Jan-2019 14:56:06 JST zunda ? nはおまけ :green_dango: zunda ? nはおまけ :green_dango:
      in reply to

      というわけで、account.reset_avatar!やaccount.reset_header!が走る前にavatar_remote_urlやheader_remote_urlを取得しとかんとかんのだね。

      In conversation Monday, 21-Jan-2019 14:56:06 JST permalink
    • zunda ? nはおまけ :green_dango: (zundan@mastodon.zunda.ninja@mastodon.zunda.ninja)'s status on Tuesday, 22-Jan-2019 05:11:04 JST zunda ? nはおまけ :green_dango: zunda ? nはおまけ :green_dango:
      in reply to

      ResolveAccountService.new.call(a) するといくつかリクエストを発行して画像ファイルもダウンロードしてくるな。

      データベースには重複のエントリは作られていない

      > SELECT id, username, domain FROM accounts WHERE username='zundan' AND domain='mstdn.jp';
      id | username | domain
      ----+----------+----------
      3 | zundan | mstdn.jp
      (1 row)

      In conversation Tuesday, 22-Jan-2019 05:11:04 JST permalink
    • zunda ? nはおまけ :green_dango: (zundan@mastodon.zunda.ninja@mastodon.zunda.ninja)'s status on Tuesday, 22-Jan-2019 05:16:40 JST zunda ? nはおまけ :green_dango: zunda ? nはおまけ :green_dango:
      in reply to

      Web UIでアイコンが全く見えなくなったのは ResolveAccountService.new.call(a) をラップトップで走らせてS3にはアップロードしてないんだろうな。もう一度one-off dynoで走らせてみよう。

      > a = Account.find_remote('zundan', 'mstdn.jp')
      > ResolveAccountService.new.call(a)

      なにもしなーい。うーん。

      In conversation Tuesday, 22-Jan-2019 05:16:40 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.