Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Secured undefined path for existing refBuilders. #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kleeb
Copy link

@kleeb kleeb commented May 10, 2017

For any usage of refBuilder, ref.parent is undefined. This causes the method to break and not index records at all.

For any usage of refBuilder, ref.parent is undefined. This causes the method to break and not index records at all.
@katowulf
Copy link
Contributor

For any usage? Examples? Are these all on the root path?

@@ -16,6 +16,7 @@ exports.fbRef = function(path) {
};

exports.pathName = function(ref) {
if(typeof ref.parent === 'undefined') return ref.path;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see ref.path in the reference guide. Guessing a better answer here would be ref.ref.key, as that should work fine with Query and DatabaseReference instances?

Copy link
Author

@kleeb kleeb May 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any usages except console.logs for this one, so more or less we can put anything here, so that the function does not throw exception and break the code flow. For my refBuilder ref.path was returning the path of monitor.
The main case is that for any refBuilder functions ref.parent is undefined.

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

Successfully merging this pull request may close these issues.

2 participants