Skip to content

Possible conflict with FlowRouter #14

Description

@arggh

I'm currently unavailable to debug this further, but I noticed a possible issue:

I was finishing up testing FiLog (1.6), and as a final step I tried logging every route change from FlowRouter like this:

const trackRouteEntry = (context) => {
  logger.debug(`Route entry ${context.path}`, context.queryParams);
};

FlowRouter.triggers.enter([trackRouteEntry]);

I had setup FiLog like this:

// /client/main.js
const consoleSender = new ConsoleSender();
const meteorSender = new MeteorClientHttpSender(Meteor.absoluteUrl('/logger'));
const teeSender = new TeeSender([meteorSender, consoleSender]);
logger = new ClientLogger(new LeveledStrategy(
  teeSender,
  teeSender,
  teeSender
));


logger.processors.push(
  new BrowserProcessor(),
  new RoutingProcessor()
);

logger.arm();

Now, if I check what happens to FlowRouter's state, it's Router.queryParamsis populated by data from logger, depending on the processors in use:

{"browser":{"platform":"MacIntel","product":"Gecko","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36","performance":{}},"routing":{"location":{"hash":"","search":"","pathname":"/","port":"3000","hostname":"localhost","host":"localhost:3000","protocol":"http:","origin":"http://localhost:3000","href":"http://localhost:3000/","ancestorOrigins":{}}},"timestamp":{"log":1479647232743}}

And the next time I try to call

FlowRouter.setQueryParams({
    randomParam: 5,
    anotherParam: true
});

all that stuff from FiLog ends up in my path / browser address bar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions