From 0b9fa8d7c31e38ea0dae66500784a3e3b8bb4b16 Mon Sep 17 00:00:00 2001 From: mikiyas-stp Date: Sat, 27 Sep 2025 14:56:29 +0100 Subject: [PATCH 1/3] version of psycopg2 changed --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index e03836c..5e11b05 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -11,7 +11,7 @@ idna==3.10 itsdangerous==2.2.0 Jinja2==3.1.5 MarkupSafe==3.0.2 -psycopg2==2.9.10 +psycopg2-binary==2.9.10 pycparser==2.22 PyJWT==2.10.1 python-dotenv==1.0.1 From 0019746f2f642a9a52f51ae80af534237a2143f6 Mon Sep 17 00:00:00 2001 From: mikiyas-stp Date: Thu, 5 Feb 2026 20:04:15 +0000 Subject: [PATCH 2/3] fix for extra long bloom: i have added a maximum length validation on the backend to define the length of bllom securely(instead of changing something on the frontend): This way i fixed the bug by allowing overly long bloom content --- backend/endpoints.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/endpoints.py b/backend/endpoints.py index 0e177a0..9890d78 100644 --- a/backend/endpoints.py +++ b/backend/endpoints.py @@ -157,8 +157,18 @@ def send_bloom(): return type_check_error user = get_current_user() - - blooms.add_bloom(sender=user, content=request.json["content"]) +#debugged for extra long bloom + content = request.json.get("content","") + MAX_BLOOM_LENGTH = 280 + if len(content) > MAX_BLOOM_LENGTH: + return make_response( + { + "success": False, + "message": f"Bloom cannot exceed {MAX_BLOOM_LENGTH} characters", + }, + 400, + ) + blooms.add_bloom(sender=user, content=content) return jsonify( { From c3d1e2a529a0f8409ca245abc29b64d5d50d573f Mon Sep 17 00:00:00 2001 From: mikiyas-stp Date: Thu, 5 Feb 2026 20:14:00 +0000 Subject: [PATCH 3/3] Fix: extend the bloom word cout to 500 on the UI at index.html and the backend endpoints as well --- backend/endpoints.py | 2 +- front-end/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/endpoints.py b/backend/endpoints.py index 9890d78..f07c377 100644 --- a/backend/endpoints.py +++ b/backend/endpoints.py @@ -159,7 +159,7 @@ def send_bloom(): user = get_current_user() #debugged for extra long bloom content = request.json.get("content","") - MAX_BLOOM_LENGTH = 280 + MAX_BLOOM_LENGTH = 500 if len(content) > MAX_BLOOM_LENGTH: return make_response( { diff --git a/front-end/index.html b/front-end/index.html index 89d6b13..91407f5 100644 --- a/front-end/index.html +++ b/front-end/index.html @@ -217,11 +217,11 @@

Share a Bloom

id="bloom-content" name="content" placeholder="What's happening?" - maxlength="280" + maxlength="500" spellcheck="true" required > -
0/280
+
0/500