firebase / firebase/geofire-js

Bug: Setting Geofire Key (childPathObj.split is not a function)

Open
#266 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.4k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

Hey there,

Been using Geofire and enjoying the functionality. However, there seems to be a bug that's causing a little pain.

When trying to set a geofire key to my realtime database, I get the following error...

![Screenshot 2023-04-16 at 12 44 00 PM](https://user-images.githubusercontent.com/83803154/232260260-53376aab-7665-4318-9072-92590f390ed9.png)

Here's my function:

```
export function setGeofireKey(
key: string,
location: [latitude: number, longitude: number],
) {
geoFire.set(key, location).then(
function () {
console.log('Provided key has been added to GeoFire')
},
function (error) {
console.log('Error: ' + error)
},
)
}
```

To be clear, I still successfully save my geofire key to the realtime database, but there's no way for me to prevent that annoying error being thrown for the user on screen which essentially runs my app unusable.

I'm using:
```
"firebase": "^9.19.1",
"geofire": "^6.0.0",
```

Thoughts?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported error from the geoFire.set entry point using the shown TypeScript function with Firebase 9.19.1 and GeoFire 6.0.0. Trace the childPathObj.split failure and verify that saving the key still succeeds; done means the error no longer reaches users while the key continues to be written.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, typescript
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.