Missing Database Record

How can you determine if you have poorly-optimized queries? Also, how do you determine if query cancellation can have a huge impact on a page or workflow?

I have an open bug report that already exists for weeks now without proper solution yet and thinking if this is connected to this one.

In one of my apps, I have a bug where client/server side is not communicating properly resulting to missing records. Scenario is given below:

  • We have Data Types “Company” and “Transaction”, where “Transaction” has a field that references to “Company”.
  • The app is a SPA (Single Page App), so no page refresh is needed most of the time. I have two separate workflows:
  1. Workflow that Creates a New Company
  2. Workflow that Creates a New Transaction for a particular Company
  • Technically speaking, you cannot create a New Transaction without the Linked Company.
  • However, upon checking my “Transactions” Data (about ~500,000 records in live database), there are 250 of them where the field “linked_company” is marked as “(deleted thing)”, but no company has been deleted, nor in my logs, nor in bubble logs as confirmed by the bubble support.
  • Upon checking, this is marked as “(deleted thing)” but when opening the record thru Data Tab in editor, there is linked unique id for that “linked_company” field but cannot be found in the database.
  • My observation in the app, and one aspect that bubble support is looking at is the possibility of sometimes having a mismatch with client-side and server-side process.
  • They say that the client-side thinks that the “New Company” has been created, wherein the server-side had trouble creating that record and failed.
  • Now the Server doesn’t have that record but the client-side thinks that this was created properly.
  • So when you create a Transaction that is linked to that Company, in client side, it proceeds to create a new transaction thinking there is the newly created company with its unique id that used as reference. The server side proceeds to create that transaction, linking the unique id generated in client-side, but now cannot find that unique id, creating a “(deleted thing)” tag in the data tab.

Upon checking in the database, there are 250 occurrences of this bug coming randomly from December 2022 up to present.

Bubble support is taking too long for investigation, and hopefully this can shed some light on what is happening in this bug.