Skip to content

ensure_token() is causing unnecessary re-authentications in user mode #8

@vsafili

Description

@vsafili

Because the try-except clause in ensure_token() catches all exceptions, any exception thrown in the GraphQL call chain causes a pause in execution to try and reauthenticate when running in user mode. However, reauthentication is not required (since the exception isn't necessarily related to auth), so things will continue running fine even if the reauthentication is interrupted.

Back when I thought reauth was required I let each one though, so on the dashboard on fflogs I have a lot of duplicates in my "Authorized Applications" list.

Printing the exception gets me this:
{'message': 'The id field must be non-zero.', 'locations': [{'line': 3, 'column': 5}], 'path': ['worldData', 'encounter']}

I get this specific exception fairly frequently with my workload, which is a lot of calls of fight.events({'sourceID': actor_id, 'dataType': GQLEnum('Casts')}) on a long list of reports and fights.

For now I've mitigated it by replacing self.user_auth() with pass in ensure_token() and it's been running fine. I'm a bit tight on deadlines right now to chase the issue and find a proper solution, so I'm just reporting it for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inefficiencySomething could be done better

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions