guardian_db icon indicating copy to clipboard operation
guardian_db copied to clipboard

Ecto.StaleEntryError when using Guardian.DB.on_revoke

Open sbinlondon opened this issue 4 years ago • 6 comments

In looking up this issue I found https://github.com/ueberauth/guardian_db/issues/102 and saw that it had been fixed, closed, and merged. But then the code that solved this was refactored in https://github.com/ueberauth/guardian_db/commit/781d0760170f69a2ee550d4371f6924d46bf74d9, removed, and never actually released.

We get tons of Ecto.StaleEntryErrors when using Guardian.DB.on_revoke. Was this written out by mistake, or was there a reason for removing it? Do you have any advice on how to fix this?

sbinlondon avatar May 18 '21 16:05 sbinlondon

It seems to be a mistake. We are in the middle of doing a lot of refactoring, here is the file with all the Ecto integration: https://github.com/ueberauth/guardian_db/blob/master/lib/guardian/db/adapter/ecto.ex

yordis avatar May 18 '21 17:05 yordis

Good to know, thank you! 😊 Do you think it will be in the next release, whenever that is?

sbinlondon avatar May 19 '21 09:05 sbinlondon

I am not sure, also we need to add back the line of code that fixes your issue if I am not mistaken.

yordis avatar May 19 '21 13:05 yordis

@sbinlondon haven't tested, but I think if you make guardian_db deps from this repo master branch and put in the Guardian.DB config this line stale_error_field: :stale_token this should fix your issue. (assuming we passing config to the actual delete() function here https://github.com/ueberauth/guardian_db/blob/master/lib/guardian/db/token.ex#L74)

alexfilatov avatar May 21 '21 10:05 alexfilatov

@alexfilatov you are right! 🚀

yordis avatar May 21 '21 18:05 yordis

Hey folks, I got lost in terms of what suppose to be the follow-up work here 😄 , do you remember?

yordis avatar Nov 08 '21 18:11 yordis

@alexfilatov any idea here?

yordis avatar Sep 11 '23 20:09 yordis

yeah, I believe no followup here, safe to close

alexfilatov avatar Sep 12 '23 10:09 alexfilatov