Repository navigation
feat(firestore): let findNearest return the calculated distance - #18838
Conversation
The parser passed a plain string into an SDK parameter that expects a field expression, so Apple builds warned and setting distance_field crashed.
… web An empty result skipped the distance assertion, so the regression could pass without checking the field the parser now sends.
Callers can set distanceField so each result includes the calculated distance. Android now forwards that name, matching web and Apple.
A dot in the name separates path segments, matching the native SDKs. An empty name is omitted from the stage map.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
The format check wants the ternary on one line.
Description
Pipeline.findNearestcan now name the result field that holds the calculated distance, matching the Android, iOS, and JavaScript SDKs. The name is a Firestore field name. A dot separates path segments. Omitting it still returns the nearest documents without the number.On Apple, the pipeline parser was passing that name as a plain string into an SDK parameter that expects a field expression. Every Apple build warned, and a caller that set the name crashed. The parser now wraps the name in a field expression. The macOS parser is a symlink to the iOS file.
Android was ignoring the name. It now passes it to
FindNearestOptions.withDistanceField. Web already copied the name through.Related Issues
distance_field(incompatible pointer types warning; unrecognized selector crash if reached) #18829Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?