Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
satoren opened this issue Sep 25, 2024 · 0 comments
Open

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

satoren opened this issue Sep 25, 2024 · 0 comments

Comments

@satoren
Copy link

satoren commented Sep 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant