Skip to content

Block incomplete profiles from commenting on all threads#9233

Merged
kevinortiz43 merged 2 commits into
developfrom
web/feature/incomplete-profile-event-comment
Jul 17, 2026
Merged

Block incomplete profiles from commenting on all threads#9233
kevinortiz43 merged 2 commits into
developfrom
web/feature/incomplete-profile-event-comment

Conversation

@kevinortiz43

@kevinortiz43 kevinortiz43 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Generalizes the incomplete-profile comment gate from event-only to all threads. A user with an incomplete profile (no photo, or fewer than 150 characters in "about me") can no longer post a comment or reply on any thread — events, community discussions, groups, guides, or places — and is shown the existing ProfileIncompleteDialog prompting them to complete their profile. This replaces the earlier event-scoped, opt-in version of this gate.

How it works

Comments are a single shared mechanism: every comment box posts via the shared Threads.PostReply RPC. The gate is enforced on both layers:

  • Backend (trust boundary): PostReply now calls has_completed_profile unconditionally and aborts FAILED_PRECONDITION / incomplete_profile_post_comment for any thread. The old event-only _is_event_thread reverse-lookup is deleted. Mirrors the CreateEvent / CreateHostRequest / CreateDiscussion pattern (a single choke point).
  • Frontend: both comment components — CommentForm (discussion/event comments + replies) and NewComment (group/guide/place CommentBox) — check accountInfo.profileComplete and open ProfileIncompleteDialog with a generic attempted_action="post_comment" ("post a comment") instead of the event-specific copy. The opt-in attemptedAction plumbing through CommentTree/EventPage is removed.

Also included

  • Push-notification banner fix carried on this branch: removes a negative top margin on PageHeader that pulled the full-bleed map up over the banner on Community/Discussion pages.

Testing

  • Backend: ruff format --check + ruff check clean; mypy verified clean on the change; pytest src/tests/test_threads.py — 22 passed, including the new/updated cases: incomplete profile blocked on an event comment, on an event reply, and on a discussion thread (proving the gate is no longer event-scoped), plus complete profile allowed.
  • Frontend: yarn format clean; tsc --noEmit introduces no new errors. New CommentForm gate tests: incomplete profile opens the dialog and does not call postReply; complete profile posts. Web unit tests (jest) run in CI — the local jest env is currently broken (next/jest resolution), so they were not run on this machine.
  • Manual, against a preview backend / local stack:
    • Complete profile (local backend running this branch): created a discussion and posted a comment — CreateDiscussion + PostReply both 200, comment persisted, no dialog.
    • Incomplete profile (online, desktop): discussion comment and event comment both show the dialog ("Before you can post a comment, you must write a bit about yourself … upload a profile photo") and send no PostReply.
    • Incomplete profile (Android emulator, WebView): discussion comment shows the same dialog, renders correctly on mobile, no comment posted.

Backend checklist

  • Added tests for any new code or added a regression test if fixing a bug
  • Run the backend locally and it works
  • Added migrations if there are any database changes, rebased onto develop if necessary for linear migration history

Web frontend checklist

  • There are no console warnings when running the app
  • Added tests where relevant
  • Clicked around my changes running locally and it works
  • Checked Desktop, Mobile and Tablet screen sizes

For maintainers

  • Maintainers can push commits to my branch
  • Maintainers can merge this PR for me

This PR was created with the Couchers PR skill.

Gate the shared Threads.PostReply RPC on event threads with
has_completed_profile (mirroring the CreateDiscussion/CreateEvent
precondition pattern), and surface ProfileIncompleteDialog on the event
comment box via an opt-in attemptedAction prop threaded EventPage ->
CommentTree -> CommentForm. Scoped to events only: discussions, groups,
and pages share the same comment components/RPC and are unaffected.

Also remove a negative top margin on the community/discussion PageHeader
that let the full-bleed map cover the push-notification banner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CouchersBot

CouchersBot commented Jul 4, 2026

Copy link
Copy Markdown
Member

Mobile

Install the Dev Tool (iOS via TestFlight, iOS Simulator, or Android .apk) here.

Scan the QR with your phone camera, or tap Open in Dev Tool on the device, to open this branch in the installed Dev Tool dev client.

    iOS         Android    
    QR to open the iOS build         QR to open the Android build    
    Open in Dev Tool         Open in Dev Tool    
Deep links

iOS

couchers-devtool://expo-development-client/?url=https%3A%2F%2Fc2c385ec--ota.preview.couchershq.org%2Fios%2Fmanifest

Android

couchers-devtool://expo-development-client/?url=https%3A%2F%2Fc2c385ec--ota.preview.couchershq.org%2Fandroid%2Fmanifest

Web (Vercel)

View the Vercel web preview for this branch.

Backend

Schema Schema diff Sample emails

Other

Protos Backend coverage Web coverage

@aapeliv

aapeliv commented Jul 6, 2026

Copy link
Copy Markdown
Member

What is the motivation for this change? Sorry I don't remember.

I'm not sure why we have an exception for events: why not implement for all threads? Also I feel like empty profiles posting on events is not much of an issue (it may get people to join, then complete profile later)?

@nabramow

nabramow commented Jul 6, 2026

Copy link
Copy Markdown
Member

What is the motivation for this change? Sorry I don't remember.

I'm not sure why we have an exception for events: why not implement for all threads? Also I feel like empty profiles posting on events is not much of an issue (it may get people to join, then complete profile later)?

We talked about it at the last meeting and Nick said moderation-wise he felt it was an issue so we decided to do it.

I might have missed something re: threads. Are you saying to do the logic upstream?

@kevinortiz43

kevinortiz43 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@aapeliv In my research we can implement it for all threads, but the specific task was to "only prevent from commenting on events" since we already had another story to prevent commenting on discussions. So you want it prevented for any type of comments?

@kevinortiz43

Copy link
Copy Markdown
Contributor Author

@aapeliv would you like to me implement this for all threads?

@kevinortiz43

kevinortiz43 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Block on all threads suggestion by Aapeli on 7/10/2026 during Couchers stand up

Generalize the incomplete-profile comment gate from event-only to every
thread (events, discussions, groups, guides, places). PostReply now
enforces has_completed_profile unconditionally as the single backend choke
point, and the frontend shows the profile-incomplete dialog on both comment
components (CommentForm and NewComment) with a generic "post a comment"
message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kevinortiz43 kevinortiz43 changed the title Block incomplete profiles from commenting on events Block incomplete profiles from commenting on all threads Jul 11, 2026
@nabramow

Copy link
Copy Markdown
Member

Hey @kevinortiz43 just a tip for the future to help your PRs get reviewed faster as I'm noticing a trend. The description, etc. looks very AI-heavy, lots of jargon and hard to read, and feels like a wall of text at first open, more text than needed for something simple like this, which makes it overwhelming. Please keep your human readers in mind!

Try to put it in your own words in the future, make sure you understand what AI did, and keep it more in the tone of "what does the reviewer actually need to know to review this?", why you made certain decisions, etc.

Otherwise it puts the burden on the reviewer to parse through everything and figure out what's going on, and when we see something very AI-heavy, it doesn't elicit trust that you know what's going on, which makes it feel like we need to have extra attention to detail when reviewing, which also takes more time.

@kevinortiz43

Copy link
Copy Markdown
Contributor Author

@nabramow understood I will rework the description of my pull requests. I have a few open ones right now would you like me to rework the descriptions and resubmit them?

@nabramow

nabramow commented Jul 14, 2026

Copy link
Copy Markdown
Member

@nabramow understood I will rework the description of my pull requests. I have a few open ones right now would you like me to rework the descriptions and resubmit them?

That would be great if you don't mind!

@kevinortiz43

Copy link
Copy Markdown
Contributor Author

@nabramow can do, also regarding the sunflower drop, I believe the deadline for that is tomorrow. I will get the PR descriptions fixed by then but I did want to move fast to try and meet the deadline. Should we move that deadline to the right? or are we going to speak more about it on Friday?

@nabramow

Copy link
Copy Markdown
Member

@nabramow can do, also regarding the sunflower drop, I believe the deadline for that is tomorrow. I will get the PR descriptions fixed by then but I did want to move fast to try and meet the deadline. Should we move that deadline to the right? or are we going to speak more about it on Friday?

It's okay we can just miss the deadline as long as we get it around that time. I also won't be able to attend this meeting Friday as I'll be on a canoe trip 😅.

@kevinortiz43

Copy link
Copy Markdown
Contributor Author

@nabramow that sounds so fun! I hope you have a great time!

Comment thread app/web/features/communities/PageHeader.tsx

@nabramow nabramow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright this seems okay to me, I've also clicked around and tested discussions and events comments with and without a profile.

@kevinortiz43
kevinortiz43 merged commit 63f473d into develop Jul 17, 2026
13 checks passed
@kevinortiz43
kevinortiz43 deleted the web/feature/incomplete-profile-event-comment branch July 17, 2026 12:38
@github-actions github-actions Bot added the release notes: pending Add to stuff that should be included in release notes label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📝 Release Notes

This PR should be included in the release notes.

Suggested release note:

Required users to complete their profile before posting comments or replies anywhere on the platform
🤖 Bot Debug Information

Model: couchers.openai.gpt-5.4
Decision: include
Reasoning: This change is user-facing and significant: it expands an existing profile-completion requirement so users must complete their profile before commenting anywhere on the platform, which affects discussions, events, groups, guides, and places. It also supports moderation and community quality, making it relevant for release notes. The banner layout fix is minor and not the main reason to include it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: pending Add to stuff that should be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discussions, replies, events, comments in events should all require complete profile and show profile-incomplete dialog if incomplete

4 participants