MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | add rebloom feature - #5
Open
marissamolejon wants to merge 1 commit into
Open
MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | add rebloom feature#5marissamolejon wants to merge 1 commit into
marissamolejon wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements "Rebloom". A user can rebloom another user's bloom; it then appears in the rebloomer's
followers' feeds, clearly attributed to both the original poster and
the rebloomer, with a visible rebloom count.
Design decisions (issue left these open)
Data model:
rebloomsis a join table referencing the originalbloom by ID, not a content-duplicating copy — consistent with how
followsandhashtagsare already modeled in this schema.Timestamps: the issue explicitly called this out as unclear.
Chose to show both — the original post's timestamp, and the
rebloom's own timestamp — with feed ordering based on whichever is
more recent. This matches familiar retweet-style UX (e.g. seeing an
old post resurface in your feed because someone you follow just
reshared it).
Self-rebloom: blocked, with a clear error message. (Debatable —
happy to revisit if the team prefers allowing it.)
Feed deduplication: if a bloom qualifies for your feed both as an
original post (you follow the author) and as a rebloom (you follow
the rebloomer), it appears once, showing whichever activity is
most recent.
Changes
Schema
rebloomstable:(id, bloom_id, rebloomer_id, rebloom_timestamp),UNIQUE(bloom_id, rebloomer_id)for idempotency.Backend
Bloomdataclass: addedrebloomer,rebloom_timestamp,rebloom_count(all optional/defaulted, so no existing call sitesneeded changes).
add_rebloom(),get_rebloom_count()inblooms.py.get_home_timeline()— replaces the old Python-sideconcatenation-and-sort with a single SQL query, unioning original
posts and reblooms, deduplicated via
DISTINCT ON. (Note: thisrequired wrapping the
UNION ALLin a subquery, since Postgresdoesn't allow
ORDER BYwith expressions directly on aUNION.)POST /rebloomendpoint — validates input, 404s on missing bloom,400s on self-rebloom, otherwise idempotent.
Frontend
apiService.rebloom().a rebloom button, and a rebloom count (shown only when > 0).
createBloom()/handleRebloom()wire it all up.Testing
Backend verified via
curl: dedup, idempotency, self-rebloomrejection, 404 handling, boundary/edge cases.
Frontend verified in-browser via DevTools: found and fixed a real
type-mismatch bug (string vs int) and a real CSS layout bug during
testing — both documented in the commit message with root cause.
Scope / follow-ups worth considering
get_rebloom_count()is called once per bloom in a loop insideget_home_timeline()- fine at current data volumes, but would beworth batching into a single query if this table grows large.
didn't request it, but it'd be a natural follow-up.