Repository navigation
London | 26-SDC-July | Raihan Sharif | Sprint 2 | rebloom - #321
RaihanSharif wants to merge 32 commits into
Conversation
initial implementation of how reblooms will be recorded. A rebloom refers to a bloom, and rebloomer. Get rebloom count by number of rows for a given bloom id in reblooms table.
By combining the blooms and reblooms, the home_timeline, other_profile endpoints don't have to change much.
The before clause now uses WHERE because it's filtering the combined blooms/reblooms. Use correct placeholder for username
add a helper function to get reblooms by a user from a given list of blooms.
…ly logged in user
Previously going to profile would keep stale bloom data, and only purging the localStorage would fix it.
7e599de to
2f5b39a
Compare
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
Solid, modular Rebloom feature! Just clean up the duplicate returns in Python, wrap your rebloom button states in try...finally, add .catch() error handling to routing fetches, and round out your .gitignore with Python/Node exclusions.
There was a problem hiding this comment.
Great progress on the reblooms implementation! Here are two quick questions to help refine the code:
- Duplicate returns: In functions like
home_timeline,user_blooms, andhashtag, did you notice consecutivereturnstatements? How might that affect whether_mark_rebloomed_by_megets executed? - Query performance: By using subqueries to count reblooms for every row in the main queries, how do you think the database performance will scale as the dataset grows?
There was a problem hiding this comment.
On the first question, I'm not quite sure what you're hinting at. Looking at those three functions again, it doesn't look like there's are consecutive return statements.
There was a problem hiding this comment.
Great, Here are a couple of quick questions to help refine it:
- Unreachable Code: In functions like
home_timeline,user_blooms, andhashtag, did you notice that the secondreturnstatement is placed right after the first one? How might that affect whether_mark_rebloomed_by_meis ever executed? - Variable Definitions: In
self_profile(), areprofile_userandprofile_usernamedefined before they are used infollowersandblooms.get_blooms_for_user()?
There was a problem hiding this comment.
Great routing setup! Notice the data type used for the port parameter in app.run()—might an integer be preferred there? Also, are all the imported view functions (like self_profile and register) accounted for in your URL rules?
There was a problem hiding this comment.
Clean schema design with proper constraints and well-chosen indexes! How do you envision reblooms_bloom_id_idx and reblooms_user_ts_idx supporting your queries for timelines and rebloom counts?
There was a problem hiding this comment.
Clean component logic for rendering reblooms!
Notice how bloomFrag is queried right at the start before it's defined or cloned from the template—how might we ensure the template is properly cloned into bloomFrag before accessing its elements?
There was a problem hiding this comment.
Great job structuring the routing logic to cleanly distinguish between real navigation and state re-renders!
Notice how apiService.getBloom includes a .catch() for error handling—might the other profile and hashtag fetch calls also benefit from error handling to prevent unhandled rejections if a network request fails?
There was a problem hiding this comment.
Clean styling! Just consider using a CSS variable for the green border and ensure display: flex is set on the footer.
There was a problem hiding this comment.
Clean and well-structured HTML template! Just remove the duplicate comments and ensure you use cloneNode(true) when instantiating it.
There was a problem hiding this comment.
Great event delegation! Just make sure to pass event into your state-change listener, wrap the rebloom action in a try...finally to reset the button state on error, and remove the redundant refreshRouteData() call on load.
There was a problem hiding this comment.
Good start! Have you considered adding ignores for your Python (venv, __pycache__, .env) and Node (node_modules, dist) environments?
Learners, PR Template
Self checklist
Task code
CYF-1171
Changelist
Blooms have a rebloom button, and rebloom count.
Users can "rebloom" a bloom they haven't already rebloomed.
On reblooming:
Fetches blooms on navigation to a page, as stale cache was an issue.