Tumblr sharing sign in flow is broken

Signing into Tumblr flow is broken for sharing scrobbling. The error comes after sign in and allow it says: No implicit conversion of String into Integer

I would love it if this feature still worked. Here is the suggested fix from chat gpt if someone could look into it? Thank you.

This error is a runtime error, not something specific to Tumblr or Trakt themselves.

The error

No implicit conversion of String into Integer

It means your code is trying to use a String where Ruby expects an Integer, most commonly as:

  • an array index

  • a numeric operation

  • a hash key mismatch (symbol vs string in some contexts)


Why it happens after Tumblr sign-in

During the Tumblr OAuth callback, Rails receives parameters like:

params = {
  "user_id" => "12345",
  "provider" => "tumblr",
  "uid" => "abc123"
}

If your code does something like:

params[:user_id]        # expects symbol
params["user_id"][0]    # treats string as array
some_array["user_id"]   # ❌ string used as index

Ruby raises:

No implicit conversion of String into Integer


The most common causes in OAuth flows

:one: Treating a hash like an array

auth = request.env["omniauth.auth"]
auth[0]        # ❌ auth is a Hash, not an Array

:white_check_mark: Fix:

auth["uid"]
auth["info"]["email"]


:two: Using a String as an array index

users = []
users["123"] = current_user   # ❌

:white_check_mark: Fix:

users[123] = current_user

Or convert explicitly:

users[params[:id].to_i]


:three: String vs Integer ID mismatch

Tumblr returns IDs as strings, Trakt often expects integers.

trakt_user_id = params[:uid]   # "12345"
User.find(trakt_user_id)       # ❌

:white_check_mark: Fix:

User.find(trakt_user_id.to_i)


:four: JSON parsed but accessed incorrectly

response = JSON.parse(body)
response[:user]["ids"]["trakt"]   # ❌ keys are strings

:white_check_mark: Fix:

response["user"]["ids"]["trakt"]

Or:

JSON.parse(body, symbolize_names: true)


Why this appears only when sharing to Trakt

Because your Tumblr login succeeds, but the failure happens when mapping Tumblr data → Trakt payload, typically here:

  • user ID mapping

  • post ID

  • media ID

  • array of shows/movies

Example failure:

payload["movies"][params[:movie_id]]

Where "movies" is an array, but params[:movie_id] is a string.


How to quickly find the exact line

Check your stack trace for something like:

TypeError: no implicit conversion of String into Integer
app/controllers/trakt_controller.rb:42

Then look for:

  • [] being used

  • Arrays indexed by params

  • IDs coming from OAuth


TL;DR

The issue is a type mismatch:

  • Tumblr OAuth gives strings

  • Your Trakt-sharing code expects integers or array indexes

Fix pattern

.to_i
.to_sym
or JSON.parse(..., symbolize_names: true)


If you want, paste:

  • the exact error line

  • or the Trakt sharing method

and I’ll pinpoint the precise bug and fix it.

1 Like

PS you guys should open source! I’m sure many people would happily help and contribute.

Their api and the web client are open source

1 Like