Skip to content

London | 26-SDC-Jul | Raihan Sharif | Sprint 1 | Bug Report: Extra long blooms - #307

Open
RaihanSharif wants to merge 2 commits into
CodeYourFuture:mainfrom
RaihanSharif:bloomLength
Open

RaihanSharif wants to merge 2 commits into
CodeYourFuture:mainfrom
RaihanSharif:bloomLength

Conversation

@RaihanSharif

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1168

Changelist

Added backend validation to ensure that bloom text cannot be longer than some constant value (MAXIMUM_BLOOM_LENGTH), if it is, send a 400 response.

@RaihanSharif RaihanSharif added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 14, 2026
@ParthibanRajasekaran ParthibanRajasekaran added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 26, 2026

@ParthibanRajasekaran ParthibanRajasekaran left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Raihan! It looks like a solid PR. Good use of the named constant to enforce the 280-character limit and block over-length blooms before storage.

Just a couple of small comments (one on scope, one on boundary testing). Let me know once you've had a chance to check them out

Comment thread .gitignore
@@ -1 +1,2 @@
.DS_Store
.vscode No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that this .vscode change is unrelated to the extra-long-bloom fix. Keeping a pull request focused on one task makes it easier to understand, test and review. Could you remove this change from the PR, or let me know if it is required for the fix?

Comment thread backend/endpoints.py
if type_check_error is not None:
return type_check_error

if len(request.json["content"]) > MAXIMUM_BLOOM_LENGTH:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boundary condition looks correct: a bloom with exactly 280 characters is allowed, while anything longer is rejected. How did you verify the behaviour at 280 and 281 characters? Checking both sides of a limit is a useful way to guard against off-by-one errors

@github-project-automation github-project-automation Bot moved this from Backlog to In Progress in Purple Forest Kanban Oct 26, 2026
@ParthibanRajasekaran ParthibanRajasekaran added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants