8000 feat(api): report or block huddl organizers and group owners by mwoods79 · Pull Request #707 · huddlz-hq/huddlz · GitHub
[go: up one dir, main page]

Skip to content

feat(api): report or block huddl organizers and group owners - #707

Merged
mwoods79 merged 3 commits into
mainfrom
app-store/organizer-moderation
Nov 25, 2026
Merged

mwoods79 merged 3 commits into
mainfrom
app-store/organizer-moderation

Conversation

@mwoods79
@mwoods79 mwoods79 commented Nov 25, 2026 •
Copy link
Copy Markdown
Contributor

Summary

Huddl & Group Moderation JSON:API
├── POST /api/json/account_reports/organizer   # report huddl organizer by huddl_id (source: :huddl)
├── POST /api/json/account_reports/group       # report group owner by group_id (source: :group)
├── POST /api/json/blocks/organizer            # block huddl organizer by huddl_id
├── POST /api/json/blocks/group                # block group owner by group_id
├── GET  /api/json/blocks                      # list caller's private blocks
├── DELETE /api/json/blocks/:id                # unblock
├── Huddl.organized_by_me / Group.owned_by_me  # hide self-moderation controls on clients
└── HideBlockedOrganizers                      # filter blocked organizers from upcoming/search/by_group

Evidence

  • Before: Clients had no way to report or block a huddl organizer or group owner without knowing their account ID, and no block table or filtering existed.
    After: Generated 20261125033612_add_user_blocks.exs migration and user_blocks snapshot (mix ash.codegen --check and mix format --check-formatted pass locally); Cucumber scenarios in huddl_organizer_moderation.feature cover reporting, blocking, unblocking, block privacy, self-block refusal, group reporting/blocking on empty public groups, and organized_by_me / owned_by_me.

Merge Danger

Door: two-way

Adds a new user_blocks table and new JSON:API routes plus read-time filtering on huddl queries. Easy to revert if unused; once users create blocks, dropping the table would lose those blocks.

Blast Radius: low

Read filtering (HideBlockedOrganizers) runs on upcoming, search, and by_group queries only when an actor is present and only hides huddlz from accounts that actor explicitly blocked.

@mwoods79
mwoods79 merged commit b2cd7ac into main Nov 25, 2026
5 checks passed
@mwoods79
mwoods79 deleted the app-store/organizer-moderation branch November 25, 2026 04:00
mwoods79 added a commit to huddlz-hq/huddlz-ios that referenced this pull request Nov 25, 2026
* Report or block a huddl's organizer or a group's owner, and unblock from your account

The huddl page and the group page get a More menu. A huddl offers Report
organizer and Block organizer. A group offers Report group and Block
group owner, so a group with no upcoming huddlz can still be reported or
blocked. Visitors are asked to sign in first, and the menu stays hidden
on a huddl you organize or a group you own.

Reports take a reason and optional details, as on the web. Blocking
hides that person's huddlz from search and group pages right away, and
the account sheet lists blocked people with an Unblock button.

Signed-in searches and group pages now send the session so the server
can leave out blocked organizers; an expired session falls back to
browsing as a visitor. Discover waits for the saved session check so it
searches once, as the right person.

The endpoints come from huddlz-hq/huddlz#707, which must deploy first.

* Clear session state on viewer change, supersede block refreshes, and enforce no-redirect policy

- Clear Discover results, cursor, and bearer token immediately whenever the viewer changes, and let moderation refreshes supersede in-flight searches or refreshes.
- Track group detail revision and viewer across both group and huddlz requests, clearing private groups on sign-out.
- Move huddl detail loading into HuddlDetailStore using the current viewer's session and clearing on viewer change.
- Share AccountRedirectPolicy with DiscoveryClient so bearer tokens never follow redirects.
- Hide the moderation menu for signed-in members until ownership finishes loading, and allow 60s for Keychain save in ModerationUITests.

* Drop pre-block cards on block revision, keep cached group pagination, and clear ownership on recheck

- Re-search Discover on blockRevision changes so a failed post-block request never leaves blocked cards or a stale pagination cursor on screen.
- Return early on GroupDetailStore cache hits before advancing revision so in-flight loadMore calls complete cleanly.
- Clear checkedUserID at the start of ModerationStore.checkOwnership so confirmed owners never flash the moderation menu on a repeat check.
- Exercise DiscoveryClient's no-redirect policy through a local loopback HTTP server in ModerationBehaviorTests.

* Keep public huddl details mounted during visitor sign-in and transient reloads

- Clear HuddlDetailStore.huddl up front only when leaving a signed-in session, keeping public details mounted during visitor-to-member sign-in so the RSVP sign-up sheet completes the home-city step.
- Keep a loaded huddl on screen on transient reload errors unless the server returns 404.

* Preserve authorization failure through visitor retry so revoked huddl details clear

- Distinguish DiscoveryError.forbidden on 403 and on a failed visitor retry after 401 while keeping the same user-facing message.
- Clear cached huddl details in HuddlDetailStore on 403, 404, or a failed post-401 retry, while still keeping loaded details on ordinary 503 reloads.

* Isolate scroll visibility and pagination trigger from DiscoveryView body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0