Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to link an existing account silently fails #8696

Closed
codeinabox opened this issue Jan 6, 2024 · 9 comments · Fixed by #8980
Closed

Attempting to link an existing account silently fails #8696

codeinabox opened this issue Jan 6, 2024 · 9 comments · Fixed by #8980
Assignees
Labels
Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Priority: 2 Important, as time permits. [managed] registration Type: Bug Something isn't working. [managed]

Comments

@codeinabox
Copy link

Evidence / Screenshot (if possible)

Screenshot 2024-01-04 at 19 37 33 Screenshot 2024-01-04 at 19 37 57

Relevant url?

https://openlibrary.org/account/login

Steps to Reproduce

  1. Sign up to Internet Archive with the "Sign in with Google" option
  2. Log into Open Library
  3. Delete Internet Archive account
  4. Create a new Internet Archive account with the same email address
  5. Log into Open Library with the "Sign in with Google" option
  6. Click the "Link accounts" button
  • Actual: The linking silently fails
  • Expected: To be able to relink my existing Open Library account with the new Internet Archive account
@codeinabox codeinabox added Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed] labels Jan 6, 2024
@sarthakkapila
Copy link
Contributor

Hey @codeinabox thanks for raising this issue, i think this is probably because the system might retain some data related to the previous association between the Open Library account and the old Internet Archive account, causing a conflict when attempting to re-link with a new Internet Archive account using the same email or it might be because of authentication tokens or session data associated with the previous account that interferes with the linking process.

That being said i think this sure needs some more discussion.

@codeinabox
Copy link
Author

Hey @codeinabox thanks for raising this issue, i think this is probably because the system might retain some data related to the previous association between the Open Library account and the old Internet Archive account, causing a conflict when attempting to re-link with a new Internet Archive account using the same email or it might be because of authentication tokens or session data associated with the previous account that interferes with the linking process.

That being said i think this sure needs some more discussion.

Not a problem, I am personally affected by this bug as I can't log into Open Library any more. I took a screenshot when trying to relink my account, so can provide details of when this error occurred and my email.

@mekarpeles
Copy link
Member

@iisa have we hit similar cases here on archive.org re: oauth?

@mekarpeles mekarpeles added registration Priority: 3 Issues that we can consider at our leisure. [managed] Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] and removed Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Needs: Lead labels Jan 8, 2024
@benbdeitch
Copy link
Contributor

If this still needs someone to work on it, I'd be happy to put some time into it! Could you assign me?

@mekarpeles
Copy link
Member

@benbdeitch this may be a tough one to debug. I think what is happening is:

When one creates or links an Open Library account to an existing archive.org account, the itemidentifier of form @archiveusername gets written to the Open Library web.ctx.store db table in the patron's json object.

If the archive.org account is deleted but the itemidentifier field persists on the patron's store object, this might cause problems. If the itemidentifier (could be spelled differently) in the store table is invalid or doesn't exist on Archive.org, we should remove / nullify this field from the store object and retry whatever function attempts to link to archive.org

One problem is, typically we create and activate an Archive.org account behind the scenes before creating an Open Library account... In accounts/models.py within audit there should be logic which handles this case, fetches the Open Library account, and then attempts to register an archive.org account + send an activation email + then link existing OL to IA on activation success + 1st login

@benbdeitch
Copy link
Contributor

Wonderful! I'll try to get started on it very soon; I accidentally overcommitted slightly, so it might be another day or two before I can properly get to this.

Out of curiousity, is the goal for this pull request to fix the issue, have the 'silent' issue notify the user, or both?

@mekarpeles
Copy link
Member

If there's a bug, we want to fix it. In the cases where a bug is encountered and there is no fix (e.g. archive.org is down while an OL patron is registering) then we want to notify the patron correctly

@mekarpeles mekarpeles added Priority: 2 Important, as time permits. [managed] and removed Priority: 3 Issues that we can consider at our leisure. [managed] labels Feb 12, 2024
@mekarpeles mekarpeles added this to the Sprint 2024-02 milestone Feb 12, 2024
@benbdeitch
Copy link
Contributor

Right, sorry that it took me so long to get to this; I'll be working on it as of tomorrow.

@benbdeitch
Copy link
Contributor

After chipping away at this, I don't think I'll be able to resolve this issue. Figuring out where the error is occurring feels like it will necessitate knowledge of how Internet Archive authenticates its users, and the relevant gitlab is restricted to staff only.

Still, it was a pleasure to try my hand at, and I think I've learned a lot about infogami in the process. Good luck to the next person to take it on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Priority: 2 Important, as time permits. [managed] registration Type: Bug Something isn't working. [managed]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants