Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(market): Handle empty agents response #8393

Conversation

Abhi1992002
Copy link
Contributor

Fixes #8370

I added a check to handle cases where no agents or featured agents are returned from the backend. This prevents the marketplace from crashing due to an undefined property error and ensures the UI still loads properly.

Changes 🏗️

Added fallback messages for when featuredAgents and topAgents are empty.

Screenshot 2024-10-22 at 6 45 45 PM

@Abhi1992002 Abhi1992002 requested a review from a team as a code owner October 22, 2024 13:21
@Abhi1992002 Abhi1992002 requested review from Torantulino and Bentlybro and removed request for a team October 22, 2024 13:21
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/m labels Oct 22, 2024
Copy link

PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

8370 - Fully compliant

Fully compliant requirements:

  • Handle cases when no agents or featured agents are returned from the backend
  • Prevent the marketplace from breaking when there are no agents
  • Display the marketplace gracefully even when there are no agents
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential Bug
The change on line 121 assumes that agent.categories is always defined. This might cause issues if categories is undefined for some agents.

Code Duplication
The messages for "No Featured Agents found" and "No Top Downloaded Agents found" are very similar. Consider extracting this into a reusable component to reduce duplication.

Copy link

netlify bot commented Oct 22, 2024

Deploy Preview for auto-gpt-docs ready!

Name Link
🔨 Latest commit db7e7f5
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6717a6e69c391d000868c12b
😎 Deploy Preview https://deploy-preview-8393--auto-gpt-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aarushik93 aarushik93 changed the base branch from master to dev October 22, 2024 13:28
autogpt_platform/supabase Outdated Show resolved Hide resolved
@aarushik93
Copy link
Contributor

@Abhi1992002 thanks for this, but the supabase submodule shouldn't be deleted in this PR. Can you please fix that?

Copy link
Contributor

@aarushik93 aarushik93 left a comment

Choose a reason for hiding this comment

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

LGTM

@aarushik93 aarushik93 enabled auto-merge (squash) October 24, 2024 16:27
@aarushik93 aarushik93 changed the title Fix/handle empty agents response #8370 fix(market): Handle empty agents response #8370 Oct 24, 2024
@aarushik93 aarushik93 changed the title fix(market): Handle empty agents response #8370 fix(market): Handle empty agents response Oct 24, 2024
@aarushik93 aarushik93 disabled auto-merge October 24, 2024 16:34
@aarushik93 aarushik93 merged commit f3a4fd2 into Significant-Gravitas:dev Oct 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 2 size/m
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Frontend/Market] Graceful handling when no agents or featured agents
3 participants