Fix validation error when region select is auto-filled
When the region select on an addresses form is auto-selected, due to the selection of a country, the addresses form will not be submittable because the actual value of the region select is no longer available. This is due to the way we hide the
option tags inside our region select that don't pertain to the current country. We're now removing all
option tags in the region select that don't pertain to the current country, which prevents the validation error from displaying unnecessarily in checkout.
Solved by Darielle Davis on the LimeCrime project. We ported her code into v3.x so all future projects can benefit. Thanks Dari!
Fix repeating query when loading featured products
When loading featured products, we were running the same query each time we looped over the collection of featured products to return them in the same order of insertion. By converting to an array before sorting each featured product and wrapping the models in view models, we're preventing execution of the query unnecessarily.
Fix error in auto-expiring Redis client for Geocoder
Since we cache Geocoder responses in Redis, a recent change to the underlying Redis ruby client forced us to implement our own
#= methods on the cache store we're using for Geocoder. Due to an issue with the order of arguments in the
Redis#setex method, errors began occurring after geocoded data was added to the application. The order of arguments has been fixed, and newly cached Geocoder responses should be properly formatted and evicted at the right time.
Discovered by John Varady. Thanks John!
Fix featured product changes on a category potentially causing request timeouts
Editing large sets of featured products caused request timeouts due to inlined
Sidekiq::Callbacks, which could initiate the
Workarea::IndexCategoryChanges many different times. We're now ensuring that all indexing jobs occur in the background so that this doesn't happen.
Fix PingHomeBaseTest adding extra plugins
Workarea::PingHomeBase causes extra plugins to appear in the
Workarea::Plugin.installed list. Exclude these test plugins from the list so we're not making additional passes for things like decorators, assets, Ruby code, and other hot-loaded items.
Handle malformed facet param on browse/search
When URLs with params like
?color=Red come through and additional filters are "shoveled" into the URL query param, the new URL would look like
?color=RedBlue because the new selection was just shoveled onto the param if it already existed. We're now ensuring that the param is an Array before generating the URL, so filter params will always come in like e.g.
Discovered by Jordan Stewart. Thanks Jordan!
Make return values of WORKAREA.currentUser more consistent
Developers interchangeably use the
gettingUserData strategies for getting user data from the system, but these two methods differ in their return value. Make the
WORKAREA.currentUser.refresh() method also return the
WORKAREA.currentUser.gettingUserData promise that it defines, or is already defined.