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

Fail more gracefully #25

Open
leggsimon opened this issue Jun 6, 2018 · 1 comment
Open

Fail more gracefully #25

leggsimon opened this issue Jun 6, 2018 · 1 comment

Comments

@leggsimon
Copy link
Contributor

leggsimon commented Jun 6, 2018

Currently if we have a problem receiving user data from next-syndication-api we can't properly render the syndication icons because we don't know what they should be for the user.

In some cases the old, smaller icons are rendered which link to http://ftsyndication.com, the now deprecated syndication platform (These were completely removed in #28 )
screenshot 2018-06-06 11 34 22

We should probably render something like we do when syndication is in maintenance mode where they all are red crosses and say there's been an issue or something like that.

Example
screenshot 2018-06-06 11 40 44

@leggsimon
Copy link
Contributor Author

leggsimon commented Jun 18, 2018

In order to show a red cross and a "something’s gone wrong" modal I think we should replicate what we do with maintenance mode.

getUserStatus()’s catch should return a custom object like this

if (response.headers.get('content-type').includes('application/json')) {
return response.json().then(error => {
error.migrated = true;
error.MAINTENANCE_MODE = true;
return error;

And then replicate this

if (USER_DATA.MAINTENANCE_MODE === true) {
const fakeRes = itemIDs.map(id => {
return {
id,
canBeSyndicated: 'maintenance',
messageCode: 'MSG_5100'
};
});
broadcast(`${EVENT_PREFIX}.fetch`, {
request: itemIDs,
response: fakeRes
});
return Promise.resolve(fakeRes);
}

and
if (USER_DATA.MAINTENANCE_MODE === true) {
message = MESSAGES.MSG_5100;
downloadButtonState = 'disabled';
saveButtonState = 'disabled';
item.title = '';
}

with a new custom message defined in config.js

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

No branches or pull requests

1 participant