Skip to content

Fix to continue with iteration when no access token is present - #17

Open
railsmechanic wants to merge 1 commit into
verdigado:mainfrom
railsmechanic:fix/directchat-iteration
Open

Fix to continue with iteration when no access token is present#17
railsmechanic wants to merge 1 commit into
verdigado:mainfrom
railsmechanic:fix/directchat-iteration

Conversation

@railsmechanic

Copy link
Copy Markdown

When a user has no access token, the script raises an error and stops. When re-running the script, it always stops at the same point. This fix skips users without or with an empty access token and continues the execution

@HerHde HerHde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, @railsmechanic!

  • Do you know how it comes that some users don't have an access token? Are we talking about a specific use case in a re-run or a bug causing it?
  • I'd like to add a log entry on skip before merging this

Otherwise this looks good to me

@railsmechanic

Copy link
Copy Markdown
Author
  • Do you know how it comes that some users don't have an access token? Are we talking about a specific use case in a re-run or a bug causing it?

To be honest, I can't give you a definite answer. I executed the script and at the point "Setting direct chats to be displayed as such for each user" the execution aborted with an error (faulty/missing) access token. Then I checked the SQLite database and noticed that there was no access token (NULL) for a number of users. Therefore I changed the script like in the PR to be able to continue with the execution.

  • I'd like to add a log entry on skip before merging this

I'll adjust the PR to log, when a user is skipped.

@HerHde

HerHde commented Jul 11, 2024

Copy link
Copy Markdown
Collaborator

I guess it might be better to wait for more insight what causes that situation. If anyone else reads this, how did this happen? 😅

@HerHde

HerHde commented Jul 16, 2024

Copy link
Copy Markdown
Collaborator

Another question that comes to my mind:
The SQLite db is not normalised, therefore the IdMappings can have different types. Are you sure that any entry of the user type had a nullish token?

Maybe you could try with this:
select * from id_mapping where type = 0 and accessToken is NULL;

Thanks a lot.

@railsmechanic

Copy link
Copy Markdown
Author

The SQLite db is not normalised, therefore the IdMappings can have different types. Are you sure that any entry of the user type had a nullish token?

I will test it again and report how it behaves now. Many thanks for your efforts. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants