These are chat archives for reactioncommerce/reaction

2nd
Sep 2016
Ron Keiser
@ronkeiser
Sep 02 2016 03:18
Hello, is anyone still around today?
Brent Hoover
@zenweasel
Sep 02 2016 03:18
Yep
Ron Keiser
@ronkeiser
Sep 02 2016 03:20
great! I have been looking at reaction today, used docker to build your master image and I really what i've seen so far
basically I have two questions right now, maybe you can help me
the first thing I'm concerned about is how changing the schemas is going to impact my ability to easily upgrade to future releases
Brent Hoover
@zenweasel
Sep 02 2016 03:22
Generally you can merge your changes with the existing schema rather than replacing
by default schemas are merged
Ron Keiser
@ronkeiser
Sep 02 2016 03:24
I see, well I'll try to summarize my situation. I am making a store with just one type of product but this product has many attributes, some of which can be categorized
I think it makes sense to make a model around this product and somehow attach it to the product model
for example, all of my products have one of six colors and it's important for my users to be able to sort/filter by that attribute
Brent Hoover
@zenweasel
Sep 02 2016 03:28
it shouldn’t be an issue when you are trying to make the schema more restrictive
Ron Keiser
@ronkeiser
Sep 02 2016 03:29
would you suggest making a migration to modify the product model and if I did that, would I have a problem later when upgrading?
Brent Hoover
@zenweasel
Sep 02 2016 03:30
No, create your own schema and then just attach it. It’s covered in the customization guide
Ron Keiser
@ronkeiser
Sep 02 2016 03:35
ok that's great. one last thing, is it safe to assume that an attached schema will overload an attribute of the same name but attributes that aren't overloaded will be preserved?
Brent Hoover
@zenweasel
Sep 02 2016 03:36
yes, when you attach a schema, but default they are merged
or you can say {replace: true}
Ron Keiser
@ronkeiser
Sep 02 2016 03:36
cool, thanks very much brent
Brent Hoover
@zenweasel
Sep 02 2016 03:36
this is not a Reaction thing, that’s how SimpleSchema works
Ron Keiser
@ronkeiser
Sep 02 2016 03:38
yes, I see I am reading about it on the meteor docs
watermelonjuice
@watermelonjuice
Sep 02 2016 09:06
blog is down
Owen Hoskins
@owenhoskins
Sep 02 2016 09:18
@zenweasel Hello! Maybe you have some insight on this or could direct my query again: I've got an issue where incoming Mailchimp links with click tracking query strings are breaking the app with errors coming out of the Flow Router package. Should the Reaction / Flow router config theoretically be able to handle "random" query strings thrown on to the end of a path for any route?
Brent Hoover
@zenweasel
Sep 02 2016 11:37
Yes, I don’t see any reason that shouldn’t work as long as it’s not matching an existing pattern
Owen Hoskins
@owenhoskins
Sep 02 2016 12:06
@zenweasel: Here's an example query string: http://localhost:3000/?ct=t(Test_send_out7_27_2016)&mc_cid=f8879293ba&mc_eid=854b1418b5
Can you reproduce the below?
"TypeError: Expected "0" to be defined
    at http://localhost:3000/packages/kadira_flow-router-ssr.js?hash=cb5097fd0bf72f2e3de9237b1dacbc3e6d545e15:2032:17
    at Router.path (http://localhost:3000/packages/kadira_flow-router-ssr.js?hash=cb5097fd0bf72f2e3de9237b1dacbc3e6d545e15:115:18)
    at Router.go (http://localhost:3000/packages/kadira_flow-router-ssr.js?hash=cb5097fd0bf72f2e3de9237b1dacbc3e6d545e15:738:23)
    at Router.initialize (http://localhost:3000/packages/kadira_flow-router-ssr.js?hash=cb5097fd0bf72f2e3de9237b1dacbc3e6d545e15:581:12)
    at Router.initPackageRoutes (http://localhost:3000/app/app.js?hash=27f7004bf45841cdbbd3081b46d7e0a682471e41:48297:14)
    at http://localhost:3000/app/app.js?hash=27f7004bf45841cdbbd3081b46d7e0a682471e41:47957:16
    at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:339:36)
    at Tracker.Computation._recompute (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:358:14)
    at Object.Tracker._runFlush (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:523:14)
    at onGlobalMessage (http://localhost:3000/packages/meteor.js?hash=ae8b8affa9680bf9720bd8f7fa112f13a62f71c3:401:23)"
Brent Hoover
@zenweasel
Sep 02 2016 12:10
Yes I see that as well
Owen Hoskins
@owenhoskins
Sep 02 2016 12:20
I have cloned of kadira_flow-router-ssr in the packages folder and am stepping through the error starting from Router.path to see if I can determine its origin
Brent Hoover
@zenweasel
Sep 02 2016 12:21
I can’t look at it right now, but can probably try to look at it tomorrow
Owen Hoskins
@owenhoskins
Sep 02 2016 12:21
(cloned because my Chrome gets confused despite the sourcemap and wants to breakpoint router.js)
Ok, that'd be greatly appreciated as always. I will report any findings.
Owen Hoskins
@owenhoskins
Sep 02 2016 13:23

My findings which I think are of interest:

The error originates from /flow-router-ssr/lib/router.js path() line 57.

On debugging I see that the pathDef equals /?ct=t(Test_send_out7_27_2016)&mc_cid=f8879293ba&mc_eid=854b1418b5

Which is passed into PathToRegexp.compile(pathDef)

But it seems like PathToRegexp.compile doesn't expect a query string as part of the pathDef, it expects an Express-style string such as "/:foo/".

"The generated function will throw on invalid input. It will do all necessary checks to ensure the generated path is valid. This method only works with strings." https://github.com/pillarjs/path-to-regexp#compile-reverse-path-to-regexp

What I can't discern is how come the pathDef contains this query string in the first place...?

Let me know if I should file this as an issue!

Aaron Judd
@aaronjudd
Sep 02 2016 17:06
@owenhoskins go ahead and file an issue on this, we might not get right to it though, but I’d like to track this and test it a little. Did you define a route that should be matching on the mail chimp return? (include what that looks like in your steps to replicate).
hrath2015
@hrath2015
Sep 02 2016 20:31
@owenhoskins it works like this http://localhost:3000/reaction/paypal/done/?ct=Test_send_out7_27_2016&mc_cid=f8879293ba&mc_eid=854b1418b5
after removing the function t() from first param. If there is ( in param it will not work and get the error
I used paypal route only for testing. May be when u are setting up click tracking in Mail Chimp try avoiding use of t( etc. or is it generated by mailchimp.