Skip to content

Suggestion to optimize Tracker.update not to send unnecessary diffs #189

Open
@satoren

Description

@satoren

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions