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

Help Center: Use default values on case of error #97053

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

heavyweight
Copy link
Contributor

@heavyweight heavyweight commented Dec 4, 2024

This is a bit oppinionated but the hc should be available no matter what.
This PR makes things a bit more resilient.
In case we fail to load a odie chat, the help center should continue working.

Related to p1733303607767299/1733233447.208929-slack-C02T4NVL4JJ

Proposed Changes

  • Add default values for messages and chat id

Why are these changes being made?

  • To ensure that users can reach support

Testing Instructions

  • Checkout this PR
  • Force the odie assistant endpoint to error out. You can force sources to be string before iterating. fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Serfg%2Qncv%2Qcyhtvaf%2Sraqcbvagf%2Sbqvr%2Qnffvfgnag.cuc%3Se%3Q00nq0488%23482-og
  • Clicking on new conversation should open properly

@heavyweight heavyweight requested review from AllTerrainDeveloper and a team December 4, 2024 11:10
@heavyweight heavyweight self-assigned this Dec 4, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 4, 2024
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

matticbot commented Dec 4, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/odie-chat-defaults on your sandbox.

messages: data.messages,
odieId: Number( data.chat_id ),
messages: data.messages || [],
odieId: Number( data.chat_id ) || chatId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are usually data.chat_id and chatId different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they should be the same

@escapemanuele escapemanuele changed the title Use default values on case of error Help Center: Use default values on case of error Dec 4, 2024
@escapemanuele escapemanuele self-requested a review December 4, 2024 17:00
Copy link
Contributor

@escapemanuele escapemanuele left a comment

Choose a reason for hiding this comment

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

Thanks for improving the robustness!

@heavyweight heavyweight merged commit edbbf0a into trunk Dec 5, 2024
11 checks passed
@heavyweight heavyweight deleted the fix/odie-chat-defaults branch December 5, 2024 11:18
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 5, 2024
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.

3 participants