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

Debounce idea inputs #350

Merged
merged 2 commits into from
Sep 16, 2024
Merged

Debounce idea inputs #350

merged 2 commits into from
Sep 16, 2024

Conversation

PragTob
Copy link
Collaborator

@PragTob PragTob commented Sep 15, 2024

Ideally these changes should be applied more globally but until we get there - this is a nice little upgrade and saves the server quite some unnecessary pain.

Chose the debounce interval of 300ms as it's apparently the default in phoenix (later versions/other setup):

Before

(small excerpt)

[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an updat", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 239µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 268µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update?", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 298µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 327µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? W", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 387µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 259µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 261µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We s", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 322µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We sh", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 273µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We sho", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 268µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We shou", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 210µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We shoul", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 279µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 258µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 234µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should d", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 255µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should de", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 302µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should deb", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 233µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debo", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 283µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debou", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 278µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should deboun", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 259µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debound", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 253µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should deboun", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 358µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounc", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 215µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 319µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 297µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/e", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 237µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/et", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 235µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/etc", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 288µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/etc.", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 300µs
After

(in full)

[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 262µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally tyu", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 209µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally ty", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 241µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in peve ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 256µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in pea", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 296µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in peace over here", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 275µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in peace over here!", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}

Docs (newest version, but works): https://hexdocs.pm/phoenix_live_view/bindings.html#rate-limiting-events-with-debounce-and-throttle

PragTob and others added 2 commits September 15, 2024 15:07
Ideally these changes should be applied more globally but until
we get there - this is a nice little upgrade and saves the
server quite some unnecessary pain.

Chose the debounce interval of 300ms as it's apparently the
default in phoenix (later versions/other setup):

<details>
<summary>Before</summary>

(small excerpt)

```
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an updat", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 239µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 268µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update?", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 298µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 327µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? W", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 387µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 259µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 261µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We s", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 322µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We sh", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 273µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We sho", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 268µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We shou", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 210µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We shoul", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 279µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 258µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 234µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should d", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 255µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should de", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 302µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should deb", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 233µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debo", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 283µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debou", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 278µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should deboun", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 259µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debound", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 253µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should deboun", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 358µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounc", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 215µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 319µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 297µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/e", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 237µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/et", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 235µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/etc", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 288µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "aEJFaToOESoSESY5KSM7NigyfSFYACwqZ3wP_vFhQSoLXHnlJEEF1eEP", "_target" => ["idea", "body"], "idea" => %{"body" => "Does every key stroke really need to trigger an update? We should debounce/etc.", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 300µs
```

</details>

<details>
<summary>After</summary>

(in full)

```
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 262µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally tyu", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 209µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally ty", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 241µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in peve ", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 256µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in pea", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 296µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in peace over here", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
[debug] Replied in 275µs
[debug] HANDLE EVENT "validate" in MindwendelWeb.BrainstormingLive.Show
  Component: MindwendelWeb.IdeaLive.FormComponent
  Parameters: %{"_csrf_token" => "ARNwSj0sHSEnJzskIBkCajszXCgQMjAY3bBsXTJcderQQrW0YDdOyWYb", "_target" => ["idea", "body"], "idea" => %{"body" => "Now I can finally type in peace over here!", "brainstorming_id" => "83e5c67e-800e-40ca-86be-8fd02a15289e", "id" => "", "username" => "Tobi"}}
```
</details>

Docs (newest version, but works): https://hexdocs.pm/phoenix_live_view/bindings.html#rate-limiting-events-with-debounce-and-throttle
@JannikStreek
Copy link
Member

cool thanks, I noticed all the spamming updates myself last time 👍

@JannikStreek JannikStreek enabled auto-merge (squash) September 16, 2024 14:59
@JannikStreek JannikStreek merged commit 28bcd96 into master Sep 16, 2024
8 checks passed
@JannikStreek JannikStreek deleted the debounce-ideas-inputs branch September 16, 2024 15:01
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

Successfully merging this pull request may close these issues.

2 participants