John Deliyiannis 9/15/2022

Strange bugs

Read Original

This 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.

Strange bugs

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