Repository navigation
Conversation
jsonb_set(attr, '{rating}', to_jsonb(rating)) is strict, so a NULL
rating (any POI with no ratings yet, i.e. most of them) made the
entire `properties` value come back NULL instead of just missing the
rating key. Callers on the openmap.lt side treat a null properties
field as "not found" and silently no-op, which looked like POI
selection was broken for most objects.
Only merge in a rating key when one actually exists; otherwise return
attr unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
places.poi_infofoldsplaces.poi.ratingintopropertiesviajsonb_set(attr, '{rating}', to_jsonb(rating)).jsonb_setis strict, so aNULLrating (any POI with no ratings — currently the vast majority) makes the wholepropertiesvalue come backNULL, not just theratingkey.properties: nullas "not found" and silently no-ops — this made POI selection appear broken for most objects, most visibly through the AI search chat'spoi:links (UI: DI dialogas užimą beveik visą mobilaus ekraną openmap.lt#69 investigation).ratingkey when one actually exists; otherwise returnattrunchanged.Test plan
places.poi_info('{"id": "12107", "mapType": "places"}'::jsonb)returnedproperties: nullbefore the fix and the correct attributes after, for a real unrated POI.🤖 Generated with Claude Code