Skip to content

Conversation

@joaquincasal
Copy link
Collaborator

Purpose

A customer is having an issue in which the dialog of the app is not displaying correctly due to a "response too big" error.

Approach

We've introduced some optimizations so requests made by the app have a smaller response size:

  • Separate entries and assets referenced in the published and current field, so responses are smaller. This also speeds up the search that happens later in the createOptions method
  • When fetching assets, use the select paramester to only retrieve the title, which is the only thing that gets used
  • Add the include: 0 parameter when using entry.getPublished since by default the response includes an include array that is not used

@joaquincasal joaquincasal requested a review from a team as a code owner December 12, 2025 17:13
Copy link
Collaborator

@FBanfi FBanfi left a comment

Choose a reason for hiding this comment

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

LGTM! 💯 🚀

});
return fetchedAssets.items;
} catch (error) {
console.error('Error fetching assets:', error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

💭 should we notify users? So they know that something went wrong. Also in the getEntries and the content type fetch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're already doing that 😎 In the createOptions function if we can't identify the entry, asset or content type we just display it as unknown. This just logs the specific error in the console to be able to debug

Copy link
Collaborator

@JuliRossi JuliRossi left a comment

Choose a reason for hiding this comment

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

Looks good! Left some questions

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.

4 participants