maps-plus icon indicating copy to clipboard operation
maps-plus copied to clipboard

Bug: Duplicate pins are sometimes rendered

Open bliew-splunk opened this issue 6 months ago • 2 comments

This bug is intermittent. It can be reproduced by opening a fresh Splunk search tab, and then running this SPL sample:

| makeresults count=5
| eval latitude=random()%90-45, longitude=random()%180-90
| table latitude longitude

Then select the Maps visualization. As expected, 5 pins are rendered.

Then, change the Time range from '24 hours' to anything else. Sometimes 10 pins in total are rendered. You may need to try this a couple times as it appears to be intermittent.

I've put together a small fix with the help of Claude here: https://github.com/sghaskell/maps-plus/compare/master...bliew-splunk:maps-plus:master, and have done some manual testing.

bliew-splunk avatar May 12 '26 23:05 bliew-splunk

Fixed in v4.6.5 (commit fa2c7dd, tag v4.6.5).

Root cause: the stale-marker cleanup added in v4.6.2 used a _markersCleared flag that was only reset when the prior render cycle delivered its trailing zero-results "done" packet. When Splunk cancels an in-flight search on a fast time-range change, that tail packet is never delivered — the flag stays set, the clear-in-place block in updateView is skipped, and the new cycle's markers stack on top of the previous cycle's.

Fix: formatData now resets _markersCleared at cycle start (when offset === 0) as a fallback, so the clear runs exactly once per render cycle regardless of whether the prior cycle's tail packet arrived. The reset is gated on offset === 0, so multi-chunk searches (>50k rows) remain unaffected and the v4.6.2 fix for #10 stays intact.

Thanks @bliew-splunk for the detailed repro and proposed patch direction — your diagnosis pointed straight at the right state variable. The shipped fix gates the reset on offset === 0 in formatData (instead of resetting at the end of every updateView) so it also preserves multi-chunk marker accumulation, but the underlying analysis is yours.

The v4.6.5 package will be available on Splunkbase shortly.

sghaskell avatar May 19 '26 22:05 sghaskell

Follow-up: v4.6.6 includes an additional fix for the underlying duplicate/stale marker issue.

v4.6.5 fixed the case where markers from a cancelled previous search could remain on the map. After further testing, we found a related case with transforming searches where Maps+ could keep markers from Splunk preview results instead of replacing them with the completed result set.

v4.6.6 now redraws from the completed Splunk result set when the search finishes, which prevents both duplicate preview markers and missing final rows.

No dashboard or SPL changes are required.

sghaskell avatar May 20 '26 14:05 sghaskell