reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.34k stars 2.17k forks source link

Call to createHandle causes a maximum stack size error #3862

Closed willopez closed 6 years ago

willopez commented 6 years ago

Prerequisites

Issue Description

When updating a product's handle(slug) a maximum stack size error is generated on the server.

Exception while invoking method 'products/updateProductField' RangeError: Maximum call stack size exceeded at createHandle (server/methods/catalog.js:123:6) at createHandle (server/methods/catalog.js:158:14) at createHandle (server/methods/catalog.js:158:14)

Function call site

https://github.com/reactioncommerce/reaction/blob/3634-willopez-remove-product-collection-hooks/server/methods/catalog.js#L931

Steps to Reproduce

Please provide starting context, i.e. logged in as a user, configure a particular payment method.

  1. Login as admin
  2. double click on a product
  3. change the permalink and press the Enter key to save
  4. Observe terminal error output, and notification on the client showing "Server Error"

Possible Solution

Rewrite the createHandle function to prevent error, it's being called recursively which causes the error.

Note to Developer

To work on this issue, rebase from this branch: 3634-willopez-remove-product-collection-hooks

Versions

Node: 8.9.4 NPM: 5.6.0 Meteor Node: 8.9.4 Meteor NPM: 5.6.0 Reaction CLI: 0.28.0 Reaction: 1.8.0 Reaction branch: 3634-willopez-remove-product-collection-hooks Docker: 17.12.0-ce

kieckhafer commented 6 years ago

This seems to be resolved in #3825

Leaving it open until that is merged.

kieckhafer commented 6 years ago

I am (still) unable to reproduce.

spencern commented 6 years ago

@willopez seems like we need more specific reproduction steps, either due to the state of the app when you're seeing this issue, or we need to consider this resolved.

willopez commented 6 years ago

@spencern @kieckhafer I am not able to reproduce it consistently. Closing this issue.