Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Hooking point for updateLocationInfo method #87

Closed
vanniktech opened this issue Nov 27, 2017 · 2 comments
Closed

Hooking point for updateLocationInfo method #87

vanniktech opened this issue Nov 27, 2017 · 2 comments

Comments

@vanniktech
Copy link
Contributor

vanniktech commented Nov 27, 2017

I'd like to have an entry point into the updateLocationInfo method.

Our use case:

All of our data is structured in a real-time database. Geohashes and data are not separated and hence data can get changed without a location change.

Example: We have point of interests that have a certain coordinate. Within those pois, we have data associated and that data can get changed. With the current implementation, we'll never see a change event for this in our listener since the location stayed the same.

Our solution: We extended the changedLocation check to also check for a versionCode that gets incremented by every data change.

Proposal: Some generic api that can handle this and other use cases. Possibly there's a method that takes the old and current snapshot and can then return an enum whether things have been added, changed, removed or nothing (null).

@vanniktech
Copy link
Contributor Author

With #113 we'd get one step closer here. We'd need to pass the old DataSnapshot (which can be null) and the current one to do a comparison.

Working with only DataSnapshot feels a bit weird. I guess it could work since we could use the underlying HashMap to get things out although I'm not sure whether the usage of that is favored or not. Also, using the HashMap and some nasty assumptions about the structure is definitely more advanced, although this entire use case is.

@samtstern
Copy link
Contributor

This issue was fixed and released in v2.2.0

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

No branches or pull requests

2 participants