Fixing the Classbar Crash Issue
This week, I successfully fixed the classbar crash issue that happened during polling updates. After debugging and tracing the issue carefully, I found that the problem came from how VenueObj was being compared.
Previously, the comparison used rev, but every time polling refreshed the data from CouchDB, the rev value changed even though it was still the same venue. Because of that, the dropdown could no longer match the selected venue correctly and caused the crash.
The solution was to compare using the stable id instead of rev:
@override
bool operator ==(Object other) =>
other is VenueObj && id == other.id;
@override
int get hashCode => id.hashCode;
This helped me better understand how polling and document updates work in CouchDB, especially the importance of using stable identifiers for comparisons.
Learning About Maintainable Code
During the weekly meeting, Dr. Shawn also advised me to think beyond just making the code work. He reminded me that maintainability and readability are very important in real development environments.
Because I did a lot of trial and error while debugging, some parts of my code structure became inconsistent between files even though the implementation should follow the same pattern. This made me realize that solving the problem is only one part of development — writing clean and understandable code is equally important.
Login Button Mockup & PR Approved
Besides debugging, I also worked on the mockup and prototype for the login button improvement. Surprisingly, Dr. Shawn approved the idea with only a minor correction, which was changing the button icon using:
import LoginIcon from '@mui/icons-material/Login';
After making the requested changes and completing testing, I successfully raised and merged another pull request into the develop branch after approval from Dr. Shawn. This gave me more confidence in contributing to the project workflow properly.
Current Issue
The main issue I am still facing is the unstructured code around the polling mixin implementation. Since there were many debugging attempts before, the current structure needs to be cleaned and standardized for better maintainability.
Looking Ahead
For next week, my plans are:
- Improve and restructure my current PR:
“Re-enable polling mixin across controller” to make the implementation cleaner and more maintainable. - Raise another PR for the debounce LLM buttons after completing proper testing and ensuring the function works correctly.
Hoping to continue improving not only in solving problems, but also in writing cleaner and more professional code moving forward.
0 Comments