Base solution for your next web application
Open Closed

Clarification Needed on Friendship Workflow Logic + GitHub Access Issue #12514


User avatar
0
maberry created

Angular Version v14.2.1

I'm trying to understand the intended workflow for the friendship system.

  • AddFriendModalComponent calls CreateFriendshipRequest in the service layer.
  • ChatBarComponent listens for app.chat.friendshipRequestReceived and handles it via onFriendshipRequestReceived.
  • ChatSignalrService appears to trigger friendship request events.
  • FriendshipAppService and FriendshipManager both expose methods for accepting requests: AcceptFriendshipRequest and AcceptFriendshipRequestAsync.

However, the actual behavior is confusing. When CreateFriendshipRequest is called, both friendship records are immediately created with FriendshipState.Accepted. There’s no pending state, no approval step, and no UI for the recipient to accept or reject the request. This seems to contradict the documentation, which describes a flow where: User1 sends a friendship request → User2 receives it → User2 accepts or rejects.

I expected a feature flag or configuration setting to control auto-acceptance, but haven’t found one. Also, the FriendshipState enum only includes Accepted and Blocked, which makes it unclear how a request phase is even represented.

Can you clarify:

  • What is the actual intended workflow for friendship requests?
  • Is there a missing enum value or undocumented feature flag?
  • Where is the UI for accepting a request supposed to appear?

Additionally, I extended my subscription recently, but my GitHub access hasn’t been restored. Could someone please help re-enable access to the private repository?

Thanks in advance. Steven

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @maberry

    Friendship System Actual Behavior vs. Expected Flow

    By default, the Friendship system in ASP.NET Zero follows an “auto-accept” approach. This is why calling CreateFriendshipRequest immediately creates two friendship records (one for each user) with the state set to FriendshipState.Accepted.

    This design is intentional and is typically suited for corporate or simpler chat scenarios, where establishing a connection between users instantly is preferred.

    Is the Expected Approval Flow (Pending - Accepted) Supported?

    Yes, ASP.NET Zero can be extended to support a manual approval flow, but this is not enabled by default.

    The FriendshipState enum only contains Accepted and Blocked values there is no Pending state, because the default implementation skips the request/approval step.

    However, you can customize this behavior as follows:

    • Extend the FriendshipState enum to include a Pending value (along with the necessary database migration).
    • Override the CreateFriendshipRequest method to create a Pending friendship record initially.
    • Implement custom methods such as AcceptFriendshipRequest and RejectFriendshipRequest to handle the approval process.

    Where Should the Accept/Reject UI Appear?

    In the current Angular UI, there is no built-in interface for accepting or rejecting friendship requests because the system auto-accepts by default. However, you can implement this functionality in the following areas:

    • ChatBarComponent: Display a toast/alert when a new friendship request is received.
    • Create a FriendRequestListComponent to show a list of pending requests, and allow users to accept or reject each one.

    Since the app.chat.friendshipRequestReceived event is already triggered via SignalR, the backend and real-time infrastructure are ready only the UI layer needs to be customized.

    Regarding GitHub Access

    If you've renewed your subscription but your GitHub access is still inactive, please follow the steps below:

    • Go to https://aspnetzero.com and log in using the account associated with your license.

    • Click the Account button in the top-right navbar, then select Manage.

    • On the account management page, go to the GitHub Members tab. This section lists the GitHub users with access to the private repository.

      • If your GitHub username is not listed, you can add it here.
      • If it’s already listed but access still isn’t working, try removing the user and adding it again.

    If that doesn’t resolve the issue, please email [email protected] with your license/subscription details and your GitHub username. The team will assist you further.

    If this is something you’d like to see as part of the framework, you can open a feature request on GitHub, and we’ll consider it for future releases.

    Thank you

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)