-
Notifications
You must be signed in to change notification settings - Fork 123
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
Feature/#443 shielding list #449
Conversation
Model/Api.php
Outdated
public function getDataCenters() | ||
{ | ||
$url = $this->config->getApiEndpoint() . 'datacenters'; | ||
return $this->_fetch($url, 'GET'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vvuksan and I are on the same page. We don't want to call /datacenters API in this way but rather want to have a static JSON file in our repo for the time being. This is not just about stability but also ensure we don't harm our own platform (API backend) by this change since we have fairly many plugin users out there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @smaeda-ks ,
I agree with these redundant functions. I've changed the code and did what you have requested in the first place.
However, I still think that pinging /datacenter
is not a big deal and its much better solution then static .json file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think you're right. But then our minimum requirement is that we must catch errors from the /datacenter
API endpoint (e.g., 503) and actually shows an error message to the logged-in user to tell "hey, something went wrong". And if there's an error at this stage we don't want to allow users to submit the form at all. So basically, users need to refresh the page or retry this flow until they can successfully fetch the shielding data from our API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smaeda-ks
Totally understands. I've removed the pinging. Thanks for collaboration
…m/favicode/fastly-magento2 into feature/fastly#443-shielding-list
this is adjusted PR for this.