trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
179 stars 7 forks source link

Locked User Accounts #228

Open rectifyer opened 3 years ago

rectifyer commented 3 years ago

As of November 9, 2020, we’re returning an error code for locked user accounts.


What does a locked account mean?

Over the past several months, Trakt performance has been negatively impacted by a huge increase in API traffic and poorly coded apps. Some apps are sending a mass amount of duplicate data to user accounts, which causes the user's account to time out on the website and API. Rather than waste API cycles, we're flagging these accounts and will return an API error until Trakt support fixes their account.

What updates does my app need?

Your app will need to handle the 423 HTTP status code and should instruct the user to contact Trakt support so we can fix their account. The API docs have more details.

How can I prevent duplicate data?

Please make sure your app isn't sending duplicate data. We typically see this with a user's watched history. Some apps are re-sending a user's entire watched history every day and as you can imagine, that quickly adds up to millions of duplicate plays. Other apps try and fix things by removing then re-adding all plays, but that just compounds the problem and makes things worse.

Please handle any error conditions the API sends. For example. if you get an timeout error when retrieving a user's watched history, don't simply assume all their data needs to be re-synced. Instead, the sync should be aborted and an error presented to the user with a way for them to retry later. We rely on apps to compare a user's Trakt and local data, and only sync up changes.

Moving Forward

We're happy to answer any questions or review code if you need help with syncing data. Just post some examples and details in this GitHub project and we'll take a look along with all the other devs.


If you have any questions, please continue the discussion below.

rudf0rd commented 3 years ago

Furthermore, this is a relatively small amount of users so it will be quite possible you never even encounter this issue. As I type this, it's .002% of the daily active users.

jonathanantoine commented 3 years ago

Hello,

A user of my app is receiving 423 status code but someone at Trakt support (Sean) told her that its account was not locked. What's happening ?

Thanks !

UweTrottmann commented 3 years ago

@rectifyer Does the website show if an account is locked? Until an app implements this, it could be helpful to direct users whose accounts show "symptoms" to check the website.

jonathanantoine commented 3 years ago

Hello @rectifyer ,

Some users don't seems to have answer to their mail related to blocked account. Is there a special email ?

Thanks a lot !

rectifyer commented 3 years ago

@UweTrottmann We don't, but that is a good idea. We plan to add some more self service ways of unlocking the account or contacting us about it more easily.

@jonathanantoine same support email, we just have a huge backlog of support requests at the moment.

jonathanantoine commented 3 years ago

Thanks @rectifyer ! By the way do you know for sure which app created the issue in the first place ? I would like to fix it if it's from my app.

rudf0rd commented 3 years ago

@jonathanantoine when I clear a user's account, I tell them which app is the offending app. At this point, I recognize most by name if they've been a part of any glitches. What's your apps name?

jonathanantoine commented 3 years ago

@rudf0rd my app is "TV Show Tracker - trakt client". It can set episode as watched only one by one (by batch but one by one). An user told me my app was responsible of the lock and I was wondering if it's because my app was the only displaying the message. Can you please tell me more 😀

rudf0rd commented 3 years ago

Ah.  Yeah I’ve seen tv show tracker come up a few times.  There’s three main reasons why we see dupes:

  1. Syncing, then for some reason deleting, then resyncing.  Rinse, repeat.  When this happens, I’ll see 300k rows and 295k are deleted.
  2. Server timeouts causing retries after the database statement has already been executed.  Usually from media centers, but not exclusively.  With this, I’ll see a ton of records but if I look at distinct watched at timestamps, it drops to a reasonable number (sub 50k).
  3. A couple apps just went wonky and sent a bunch of bad data.  Timestamps are always set to right now so there’s no deduping possible except to go to 1 play per item.
  4. Bonus possible 4th.. I don’t know this one for certain but I think it’s possible two apps fight over who is the primary data and sync over each other.  Only seen this a couple of times and it was mobile apps.

I think your app falls into #2.  I’ll see if I can find an example tomorrow.

jonathanantoine commented 3 years ago

Thanks a lot Sean,

For you to knoy my app did not attempt retries until a week or so. It was a direct call on a user action (tick a box or click a button) with immediate feedback to the user.

Is it possible that when creating a new account and setting all ehe already watched shows it trigger the "locking process"?

Thanks for your input @rudf0rd !

rudf0rd commented 3 years ago

@jonathanantoine

Ok I have one I'm looking at right now. Here's some example data:

During this time period, we really didn't have any large server issues like we were seeing back in October/November, so I don't think is timeout/retry from a 5xx server response. Did something change in your app around this time?

jonathanantoine commented 3 years ago

@rudf0rd not real change... that's really strange. Can this be a webhook ? Do you know if it's always the same items being set as played ?

rudf0rd commented 3 years ago

@jonathanantoine when another case comes up, i'll check to see if there's any pattern to what's being repeated, but it seems like it's fairly widespread across the library

jonathanantoine commented 3 years ago

@rudf0rd Can you tell me if you still have this behavior for my app ? Now the only time it send again a "set as seen" command is if the APi does not answer by a 200 status code.

rudf0rd commented 3 years ago

@jonathanantoine yes, most definitely. I sent you an email on Monday (i think) regarding the incredibly high duplicate rates (in the millions).

jonathanantoine commented 3 years ago

@rudf0rd I didn't received it :( can you send it at apps [at] jonathanantoine.com ? I would to be able to chat with you via a more direct method (discord, etc.) if that don't bother you. I don't like the idea of spamming your API and I would love to fix it ASAP.

Gibby commented 3 years ago

Was there a special email made yet by chance for requesting help with a locked account? I contacted support last week using the link in OP.

KathleenMc73 commented 3 years ago

I am getting a message saying my account is locked. Can I get it unlocked please. Also, having installed the TV tracker app onto my new phone I am getting a message saying sync failure so none of my inputted data is appearing.

vlevas commented 12 months ago

Hello i also have problem and send a ticket but nothing yet :/ @rudf0rd is possible to help me? the username is: valantislevas i already send a ticket

trevevs commented 4 months ago

hey, this happened to me too. cant see any way to raise a trakt support ticket- they removed it? how do I fix? thanks

rectifyer commented 4 months ago

You can use the support portal or email support@trakt.tv directly.