Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

fix: Fix app hang when promise returns undefined #575

Merged
merged 2 commits into from
Oct 13, 2017

Conversation

thevoiceofzeke
Copy link
Contributor

After pointing star app at new messages feed, the service fails to get messages (a bigger problem than this PR addresses). When it fails, the angular controls hangs because the promise returns undefined. This PR just makes sure the block doesn't continue if the promise result is undefined.


Contributor License Agreement adherence:

// Ensure messages exist and check for group filtering
if (result.messages && result.messages.length > 0) {
allMessages = result.messages;
if (result) {
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ should this be handled at the messagesService layer?
replacing undefined with []?

❓ could this be labeled with TODO or FIXME as a reminder that it is a short term fix?

Copy link
Contributor

@apetro apetro left a comment

Choose a reason for hiding this comment

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

+1 for failing gracefully.

@thevoiceofzeke thevoiceofzeke dismissed ChristianMurphy’s stale review October 13, 2017 03:56

Implemented requested change

@thevoiceofzeke thevoiceofzeke merged commit 1d345f1 into uPortal-Attic:master Oct 13, 2017
Copy link
Contributor

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

Thanks @thevoiceofzeke! 👍

@vertein vertein added this to the 6.1.0 milestone Oct 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants