sbenhaim / protobrew

Meteor.js wiki engine
4 stars 4 forks source link

history: "revisions" view fresh page load results in stack trace #111

Closed posborne closed 10 years ago

posborne commented 10 years ago

Steps to repro:

  1. Navigate to a revision of a page (this works)
  2. Ctrl-F5
funkyeah commented 10 years ago

looks like its just a reactive race condition

the code requires the entries collection to be loaded prior to the revision template being rendered... you can either use the waitOn method in the router, to not load the revision template until after the entries collection has loaded, or you can just use:

if revision?
    moment(revision.date).fromNow()

i think the code re-runs when the entries collection loads, so if you just make your code ignore the invalid state