phoenix_pubsub icon indicating copy to clipboard operation
phoenix_pubsub copied to clipboard

Suggestion to optimize Tracker.update not to send unnecessary diffs

Open satoren opened this issue 1 year ago • 0 comments

Currently, when Tracker.update is run, a new ref is created regardless of whether there is a change or not and a diff is generated.

e.g.

      iex> Phoenix.Tracker.update(MyTracker, self(), "lobby", u.id, fn meta -> Map.put(meta, :away, true) end)
      # Since the same values are set, there is no change in meta, but a diff is reported.
      iex> Phoenix.Tracker.update(MyTracker, self(), "lobby", u.id, fn meta -> Map.put(meta, :away, true) end)

What about making a change or adding an option to suppress this? If this suggestion is acceptable, I will create a patch.

satoren avatar Sep 25 '24 01:09 satoren