Skip to content

Pins: Consider external updates and allow ignoring change sources#768

Open
oeninghe-dataport wants to merge 7 commits into
nextfrom
fix/766-pins-consider-external-updates
Open

Pins: Consider external updates and allow ignoring change sources#768
oeninghe-dataport wants to merge 7 commits into
nextfrom
fix/766-pins-consider-external-updates

Conversation

@oeninghe-dataport

Copy link
Copy Markdown
Collaborator

Summary

Consider external updates (#766) and allow ignoring change sources (#655).

Instructions for local reproduction and review

See #766 and #655

Relevant tickets, issues, et cetera

Fixes #766
Fixes #655

As we use the vite plugin enriched console, we do not specify the source
of a log message manually.
This ignores changes originated from addressSearch to the pins
coordinate for the reverseGeocoder in the snowbox.

Fixes #655
@oeninghe-dataport oeninghe-dataport added this to the POLAR@3 milestone Jun 3, 2026
@oeninghe-dataport oeninghe-dataport self-assigned this Jun 3, 2026
@oeninghe-dataport oeninghe-dataport requested a review from a team June 3, 2026 16:34
@oeninghe-dataport oeninghe-dataport added the bug Something isn't working label Jun 3, 2026
@dopenguin

Copy link
Copy Markdown
Member

The target should probably be next and not main, @oeninghe-dataport 😄

@warm-coolguy warm-coolguy changed the base branch from main to next June 22, 2026 09:22
@warm-coolguy

Copy link
Copy Markdown
Member

The target should probably be next and not main, @oeninghe-dataport 😄

Fixed.

sailormoonmeme_6358795

@dopenguin dopenguin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

)
return
}

watcherConfig.handle = watch(
() => store[watcherConfig.source.key],
watcherConfig.callback,
(value) => {
const sourceKey = watcherConfig.source.key + 'Source'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This lacks documentation. Please add information e.g. to the TSDoc of the composable that, if I watch the parameter coordinate I will ignore updates if I have a parameter coordinateSource in my store and have ignoredSources configured.

As this requires a lot of knowledge and extra implementation for each plugin with a possible reference loop, isn't there a possibility of a different approach without the need of further boilerplate in any plugins?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For the documentation: dfb50f2

On your question:

I'm also not too happy with the current solution. However, the following aspects convinced me to go with this:

  • The pins plugin seems to be the natural participant in reference loops, even in the future. It allows reading and writing of other plugins in a useful way, which is the case for few plugins; usually, our plugins communicate in one direction only. I don't expect that we will need this in another plugin in the future.
  • I found no approach without further boilerplate (that is not much more "hack-y" than this one). At least this approach allows re-using it in every plugin that refers to pins.

Comment thread src/plugins/pins/store.ts
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Dataport.github.io/polar/pr-preview/pr-768/

Built to branch gh-pages at 2026-07-10 13:08 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@oeninghe-dataport

Copy link
Copy Markdown
Collaborator Author

🏓 @dopenguin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes to pins coordinate are not reflected in the map AddressSearch, Pins, ReverseGeocoder: Reference hell

3 participants