Three times now I have had a perfect app with a table on it with correct columns. Then did or three changes taht worked perfect and then poof the table is all screwed up, data in wrong cols all over.
When i ask to undo those changes it screws it up more and takes days to get back to normal.
I love this system but the rollback logic of using the log instead of a versioned codebase sucks as it NEVER rolls back correctly and after is hell to fix. I just added one col and it tore the whole thing to shreds, i asked it to undo those changes and it made it worse and continues to with each try.
I’m making an assumption here - but are you actually asking the AI to roll back/undo the changes? If so, this will definitely result in some errors, I experienced this myself when first starting out with Firebase Studio.
Instead, use the ‘Restore’ button on a last known good checkpoint. After the AI makes changes, it will automatically create a restore point - using this will revert the code line by line to what it was before. This is the general process I use:
- Get the AI to write a plan for the feature (no code changes yet). Iterate the plan if need be, but have a solid plan initially.
- Tackle the plan in very small tasks.
- (Optional) Check the code the AI has written after each task is complete - you can do this by clicking the actual code file(s) in the image. You don’t need to be fluent in that code, but you can see the extent of the changes the AI made and whether it has changed some files/lines unnecessarily.
- QA’/test the change made. And sanity check other parts of the app that may be part of that same code file (this is where step 3 helps).
- If the change has introduced bugs or unexpected behaviour, Restore to a previous checkpoint, tell the AI you’ve restored (it will know anyway), explain the issue and what could have gone wrong. Explicitly ask for no code changes at this point, otherwise it will go ahead and try another change! Often the AI will know what it did wrong, and the next time the change will be good.
I use ‘Restore’ a lot, and the AI will eventually get the change right.
Finally, it’s really important to create a GitHub account (free) and connect your project to your Github account. This ensures all of your project files are safely backed up elsewhere. Generally, I push my new changes to github frequently, and in cases where the AI makes a mistake, and breaks a part of your app (and can’t seem to fix it), you can compare your known working version in github to the project file to find the issue. The AI will even help you do this.