Skip to content

James Postadan | Oct2025-2 | Module Legacy Code | Sprint 1 | Rebloom - #7

Open
japostadan wants to merge 1 commit into
issue-08-unfollowfrom
issue-09-rebloom
Open

James Postadan | Oct2025-2 | Module Legacy Code | Sprint 1 | Rebloom#7
japostadan wants to merge 1 commit into
issue-08-unfollowfrom
issue-09-rebloom

Conversation

@japostadan

@japostadan japostadan commented Jun 17, 2026

Copy link
Copy Markdown
Owner

🎯 Summary

  • Schema: added rebloom_of BIGINT REFERENCES blooms(id) to the blooms table
  • Backend: add_rebloom() data fn; POST /rebloom/<bloom_id> endpoint; Bloom dataclass gains rebloom_of, original_sender, rebloom_count
  • Frontend: Rebloom button on every bloom card; attribution line shown when original_sender is set; rebloom count shown when > 0
  • Reblooming a rebloom returns 400 — only original blooms can be rebloomed

🧾 Changelist

  • Schema: rebloom_of BIGINT REFERENCES blooms(id) column added to blooms. NULL for original blooms. All bloom queries updated with a shared column/join fragment to retrieve original_sender and rebloom_count.
  • Backend: add_rebloom(rebloomer, bloom_id) inserts a new bloom row referencing the original. POST /rebloom/<bloom_id> requires JWT, checks the target bloom is not itself a rebloom (returns 400 if so), calls add_rebloom, returns the new bloom. Bloom dataclass extended with rebloom_of, original_sender, rebloom_count.
  • Frontend: Rebloom button added to every bloom card. On click, calls apiService.rebloom() and refreshes the feed. Attribution line "Rebloomed from <user>" shown when original_sender is present. Rebloom count displayed when > 0.
  • Tests: 6 backend integration tests (success, appears in profile, original_sender set, rebloom-of-rebloom rejected, count increments, 404 for missing bloom) + 3 Playwright E2E tests (button visible, rebloomed bloom appears in profile with attribution). Full suite 25/25 pass.

Questions

  • There is currently no "unrebloom" feature — once rebloomed it cannot be undone. Should that be a follow-up issue, or is it out of scope for this module?
  • If the original bloom is deleted, the rebloom row becomes an orphan (the FK has no ON DELETE CASCADE). Should cascading deletes be added to the schema?

🙌 Notes for Reviewers

  • Upstream issue: Purple Forest: New Feature: Rebloom CodeYourFuture/Module-Legacy-Code#9
  • Backend tests: python3 -m unittest endpoints_test -v from backend/
  • E2E tests: npx playwright test (serial mode) from front-end/
  • Full suite: node_modules/.bin/http-server . -p 5500 --silent & npx playwright test — 25/25 pass
  • DB reset required before first run: docker compose down -v && docker compose up -d --build && docker compose exec backend python populate.py

Schema: add rebloom_of FK to blooms table.
Backend: add_rebloom() data fn, POST /rebloom/<id> endpoint; Bloom dataclass
gains rebloom_of, original_sender, rebloom_count fields; all queries updated.
Frontend: Rebloom button on each bloom, attribution div shown when rebloomed,
rebloom count shown when > 0.
Tests: 6 backend integration tests + 3 Playwright E2E tests (serial mode to
prevent parallel-worker race on shared follow state). Fixed home spec to use
filter().first() and correct followed-user assertion (Swiz not JustSomeGuy).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant