MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | fix bloom length limit - #2
Open
marissamolejon wants to merge 1 commit into
Open
MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | fix bloom length limit#2marissamolejon 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
blooms longer than 280 characters could be stored, because
the character limit was only enforced in the frontend and never
validated by the API.
Fix
Added a
MAXIMUM_BLOOM_LENGTH = 280constant and a length check insend_bloom(), mirroring the existingMINIMUM_PASSWORD_LENGTHvalidation pattern already used in
register():No frontend changes were needed —
front-end/lib/api.mjs's existinggeneric error handling (
_apiRequest→handleErrorDialog) alreadysurfaces any
{success: false, message: ...}400 response, the sameway it does for the "Incorrect password" error, so this new
validation error displays correctly with zero additional UI work.
Testing
Verified manually via
curlagainst a running local backend:400, correct message.inclusive, no off-by-one).
exactly at 280, not 281 or 279).
Scope / Known follow-up
This PR only adds validation for new blooms going forward. It does
not retroactively clean up existing over-length data already in
the database (e.g. the seeded bloom on
AS's profile referenced inthe issue). That's a data-cleanup concern, not a validation bug, and
involves a separate judgment call (truncate vs. delete vs. leave as
a grandfathered exception) that felt out of scope for this fix. Happy
to open a follow-up issue if the reviewer wants that addressed.