Strange bugs
Read OriginalThis article describes two unusual bugs encountered in a Rails application. The first bug involves a string comparison failure due to invisible special characters introduced via copy-paste, which were not visible in console output but caused equality checks to fail. The fix involved using `.split('')` to reveal the extra characters. The second bug concerns a PostgreSQL foreign key violation when deleting users, caused by a `default_scope` that filtered out tasks with a nil field, preventing deletion of tasks that had that field set to nil. The article explains the debugging process and lessons learned about input validation and the dangers of default_scope.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser
Top of the Week
No top articles yet