-
Notifications
You must be signed in to change notification settings - Fork 144
Adding a refBuilder hangs flashlight #129
Comments
Would need a complete, minimal repro with version info to be any help here. |
Same problem here. Using
It does not index anything. |
I've the same problem, who can help?, i added indexOn on timestamp, but this don't work, thanx. |
Put a try catch around the inner code of PathMonitor constructor to see the error in the console. The problem is there. The statement that blows is console.log('Indexing %s/%s from DB "%s"'.grey, path.index, path.type, fbutil.pathName(this.ref)); because of fbutil.pathName(). refBuilder creates a wrong ref for a reason that I do not understand. Seems a race condition because adding some console.log here and there solved the problem for me. |
Can you share your PathMonitor?, i put console.log
In the config i've: But in the console i only see: |
JSON.stringify does not show functions. Add console.log() for the ref before and after is has been replaced by refBuilder. In my case the replacement gave a wrong ref. But after adding other console.logs, it started to give the right one. In case, console.log(ref) should be the same thing before and after the replacement. console.log(ref) gives the firebase path to your document. |
Here is my path monitorconstructor: function PathMonitor(esc, path) {
this.index = path.index; this._init(); |
By the way in fbutils you should adjust pathName like so: exports.pathName = function(ref) { |
Thanx, but the result is not indexed u.u: ` ` I did the changes but not work yet, i will review later thanx. |
print your ref once replaced by refBuilder. If should be the same as before ( https://flashligth-9cc16.firebaseio.com/users) |
Before refBuilder:
Path:
exports.paths = [{ path: "nuggets", index: "firebase", type: "nugget", filter: function(data){ return (data.hasOwnProperty('published') && (data.published == true))||(!data.hasOwnProperty('published')); } },{ path: "tags", index: "firebase", type: "tag" } ];
Result:
After refBuilder:
exports.paths = [{ path: "nuggets", index: "firebase", type: "nugget", refBuilder: function(ref, path) { return ref.orderByChild('createdAt').startAt(Date.now());}, filter: function(data){ return (data.hasOwnProperty('published') && (data.published == true))||(!data.hasOwnProperty('published')); } },{ path: "tags", index: "firebase", type: "tag" } ];
Result:
The text was updated successfully, but these errors were encountered: