Skip to content

Bug: Crash when an account is deleted #1967

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

Open
4 of 9 tasks
jakubkottnauer opened this issue Mar 10, 2025 · 5 comments
Open
4 of 9 tasks

Bug: Crash when an account is deleted #1967

jakubkottnauer opened this issue Mar 10, 2025 · 5 comments
Labels
ℹ️ Needs info Further information is requested 2️⃣ Medium Priority Community contributions accepted, Maybe team only works on if there are no high priority items open

Comments

@jakubkottnauer
Copy link
Contributor

Before you start (required)

General checklist

  • I have removed personal / sensitive data from screenshots and logs
  • I have searched existing issues and discussions to ensure this is not a duplicate issue

How are you using Maybe?

  • I am a paying Maybe customer (hosted version)
    • Paying Maybe users can also open requests in Intercom (if there is sensitive info involved)
  • I am a self-hosted user

Self hoster checklist

  • Self hosted app commit SHA (find in user menu): a3cd5f4
    • I have confirmed that my app's commit is the latest version of Maybe
  • Where are you hosting?
    • Render
    • Docker Compose
    • Umbrel
    • Other (please specify)

Bug description

When you delete an account, Maybe crashes. Sentry stack trace attached below.

To Reproduce

  1. Create a new account
  2. Try to delete

Expected behavior

It should be possible to delete accounts without errors

Screenshots and/or recordings

Image Image Image
@zachgoll zachgoll added the 2️⃣ Medium Priority Community contributions accepted, Maybe team only works on if there are no high priority items open label Mar 10, 2025
@zachgoll
Copy link
Collaborator

@jakubkottnauer are you able to reproduce this with a brand new account reliably? I can't get this to work on my end with the supplied repro steps:

CleanShot.2025-03-11.at.10.30.12.mp4

@zachgoll zachgoll added the ℹ️ Needs info Further information is requested label Mar 11, 2025
@jakubkottnauer
Copy link
Contributor Author

@zachgoll yup, can consistently reproduce this. I've recorded a video:

Kapture.2025-03-12.at.17.00.49.mp4

@zachgoll
Copy link
Collaborator

@jakubkottnauer I'm following those exact steps and not getting the error locally and in my fresh self hosted instance, which tells me that this has something to do with the data that is in your database.

What does this return for you?

SELECT DISTINCT accountable_type FROM accounts;

I'd be looking for any NULL values (which would indicate the problem).

@jakubkottnauer
Copy link
Contributor Author

jakubkottnauer commented Mar 18, 2025

Oh yes, there's a thing I forgot to mention - the app loads just fine when I refresh the page after the crash 😄 My bad for missing out this crucial piece of info. That means any potential NULL values there would only be there for a split second, if at all.

I see how you're thinking, considering that it crashes on this line <%= circle_logo(account.name, hex: color || account.accountable.color, size: size) %>

Attaching what the output of the query looks like, but yeah, no NULLs as expected:

Image

I can try debugging this locally later this week.

@zachgoll
Copy link
Collaborator

@jakubkottnauer hmmm, that's interesting. It's almost as if account.destroy is not running in a DB transaction and the accountable is first deleted, the error happens, then the account is deleted.

As far as I'm aware, ActiveRecord already wraps destroy methods in a transaction? But maybe that assumption is wrong, which might explain this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ℹ️ Needs info Further information is requested 2️⃣ Medium Priority Community contributions accepted, Maybe team only works on if there are no high priority items open
Projects
None yet
Development

No branches or pull requests

2 participants