Til 2025-03-27

Again, the old lesson is still valuable: loading state is important and requires more consideration than we thought. This reminds me again of ReactJS’s core principle (from my understanding, not from the official docs): we can’t control how many times ReactJS rerenders, what we can (actually SHOULD care) is what the view looks like with the given props and state. I truly love this simple concept of ReactJS and believe this is the reason makes ReactJS powerful.
In Hasura, we can’t delete a column in a table WHILE some role still use it. I have a
notifications
table and I configured theuser
role to have “select” permission for the columntitle
. Hasura won’t allow me to delete this column. So we need to update the permission first, and regression test if have.Thanks to this podcast, it’s truly awesome and super easy to understand, no fancy words, no flashy adjectives, here is one of them that I translated into my own words, it’s a very key concept in the AI world
What’s the FUNDAMENTAL different between classical predited AI, generative AI, and agentic AI
Classical predictive AI: “predict” from existing data, just forcasting
Generative AI: “create” new content, like ChatGPT, DALL-E does
Agentic AI: go beyond prediction and creation. It’s about making decision, taking actions to achive specific goals.
Rails still run the migration even if the file name timestamp is from the last year like
20240311xxx
, as long as Rails didn’t run it before.Rails migration feature seemed awesome at first, but when working with multiple branches, it was troublesome. If my
branch-a
adding a new table,branch-b
adding another table, switching between them will cause migration sucks with something like this situationup 20250326064935 ********** NO FILE ********** up 20250326064936 ********** NO FILE **********
Rollback doesn’t work, what we need to fix is “delete” these 2 items from Rails “brain” by using Rails console and hack like this
rails console ActiveRecord::Base.connection.execute("DELETE FROM schema_migrations WHERE version = '20250326064936'") ActiveRecord::Base.connection.execute("DELETE FROM schema_migrations WHERE version = '20250326064935'")
While this is not really a hack, we need to understand how Rails works. This is the traditional problem for old architecture since we have only one single database, it’s fine. But DX is terrible to me. While Rails is a good framework but its most powerful capability is ActiveRecord becomes fucking useless when I use Hasura. I will never use Rails for any of my apps. Building RESTful API? Well, another horrible stupid approach as well. RESTful was terrible.
Inferring value from the first item in a list is error-prone! We should iterate through all items in the list and find the correct item instead.
Subscribe to my newsletter
Read articles from ShinaBR2 directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

ShinaBR2
ShinaBR2
Enthusiasm for building products with less code but more reliable.