Skip to content
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

route:update events have a Vehicle argument? #30

Closed
faultyserver opened this issue Sep 22, 2016 · 1 comment
Closed

route:update events have a Vehicle argument? #30

faultyserver opened this issue Sep 22, 2016 · 1 comment
Labels
Milestone

Comments

@faultyserver
Copy link
Member

I recently noticed this event come through:

#<Shark::Event:0x007fd9c3f12eb8
  @topic="routes.1B",
  @type=:update,
  @args=[
    #<Shark::Vehicle:0x007fd9c2946828
      @associated_objects={},
      @name="4008",
      ...
    >
  ],
  @kwargs={},
  @originator="vehicles.4008"
>

That is, an :update event to a Route topic is being passed a Vehicle argument instead of the Route that is being updated. Note that the argument being passed is the Vehicle that originated the event, meaning this is likely an issue with how Conductor is publishing these events.

@faultyserver faultyserver added this to the v1.0 milestone Sep 22, 2016
@faultyserver
Copy link
Member Author

Turns out this was just a mistake in the REPL code. I was using last :update, to: 'routes.1B', which in turn ran this line:

@events[to].find{ |event| event.type = type }

Having the single = in the find condition meant that the latest event (no matter the type; in this case a :vehicle_update, where a Vehicle argument makes sense) would always be taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant