From d0cf6d8c9f2da278af3b322c80926c0942a34dfa Mon Sep 17 00:00:00 2001 From: enjoy15 Date: Sat, 6 Jun 2026 23:34:07 +0100 Subject: [PATCH 1/3] Fix event listener for login form submission in hashtag and profile views --- front-end/views/hashtag.mjs | 4 ++-- front-end/views/profile.mjs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/front-end/views/hashtag.mjs b/front-end/views/hashtag.mjs index 7b7e9969..1ce38dd5 100644 --- a/front-end/views/hashtag.mjs +++ b/front-end/views/hashtag.mjs @@ -35,8 +35,8 @@ function hashtagView(hashtag) { createLogin ); document - .querySelector("[data-action='login']") - ?.addEventListener("click", handleLogin); + .querySelector("[data-form='login']") + ?.addEventListener("submit", handleLogin); renderOne( state.currentHashtag, diff --git a/front-end/views/profile.mjs b/front-end/views/profile.mjs index dd2b92af..31139a9f 100644 --- a/front-end/views/profile.mjs +++ b/front-end/views/profile.mjs @@ -39,8 +39,8 @@ function profileView(username) { createLogin ); document - .querySelector("[data-action='login']") - ?.addEventListener("click", handleLogin); + .querySelector("[data-form='login']") + ?.addEventListener("submit", handleLogin); const profileData = state.profiles.find((p) => p.username === username); if (profileData) { From 50298a3e03e2f743cd5f8e1999a639e48ee0c9fe Mon Sep 17 00:00:00 2001 From: enjoy15 Date: Tue, 9 Jun 2026 21:56:42 +0100 Subject: [PATCH 2/3] Update .gitignore to include additional environment and build files --- .gitignore | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.gitignore b/.gitignore index e43b0f98..75d570df 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,26 @@ .DS_Store + +# Python +__pycache__/ +*.py[cod] +.pytest_cache/ +.coverage +.venv/ +backend/venv/ + +# Environment files +.env +backend/.env + +# Node / frontend +node_modules/ +front-end/node_modules/ +playwright-report/ +test-results/ + +# Database data +db/pg_data/ + +# Editor / OS files +.idea/ +.vscode/ From 6a28394ae572bdc88b57e9e6ad7aaafce1cfc4dd Mon Sep 17 00:00:00 2001 From: enjoy15 Date: Tue, 9 Jun 2026 22:27:54 +0100 Subject: [PATCH 3/3] Add content length validation for bloom submissions --- backend/endpoints.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/endpoints.py b/backend/endpoints.py index 0e177a07..eb850bab 100644 --- a/backend/endpoints.py +++ b/backend/endpoints.py @@ -156,9 +156,21 @@ def send_bloom(): if type_check_error is not None: return type_check_error + content = request.json["content"] + if len(content) > 280: + return make_response( + ( + { + "success": False, + "message": "Bloom content must be 280 characters or less", + }, + 400, + ) + ) + user = get_current_user() - blooms.add_bloom(sender=user, content=request.json["content"]) + blooms.add_bloom(sender=user, content=content) return jsonify( {